mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Skip unmarshaled fields with generating compatibility fixtures
This commit is contained in:
parent
5f9a042284
commit
688f5babba
@ -133,6 +133,10 @@ func fill(dataString string, dataInt int, t reflect.Type, v reflect.Value, fillF
|
|||||||
|
|
||||||
// use the json field name, which must be stable
|
// use the json field name, which must be stable
|
||||||
dataString := strings.Split(field.Tag.Get("json"), ",")[0]
|
dataString := strings.Split(field.Tag.Get("json"), ",")[0]
|
||||||
|
if dataString == "-" {
|
||||||
|
// unserialized field, no need to fill it
|
||||||
|
continue
|
||||||
|
}
|
||||||
if len(dataString) == 0 {
|
if len(dataString) == 0 {
|
||||||
// fall back to the struct field name if there is no json field name
|
// fall back to the struct field name if there is no json field name
|
||||||
dataString = "<no json tag> " + field.Name
|
dataString = "<no json tag> " + field.Name
|
||||||
|
Loading…
Reference in New Issue
Block a user