mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 10:20:51 +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
|
||||
dataString := strings.Split(field.Tag.Get("json"), ",")[0]
|
||||
if dataString == "-" {
|
||||
// unserialized field, no need to fill it
|
||||
continue
|
||||
}
|
||||
if len(dataString) == 0 {
|
||||
// fall back to the struct field name if there is no json field name
|
||||
dataString = "<no json tag> " + field.Name
|
||||
|
Loading…
Reference in New Issue
Block a user