MCPcopy Index your code
hub / github.com/cloudfoundry/cli / removeDuplicateMapKeys

Function removeDuplicateMapKeys

util/manifestparser/process.go:71–84  ·  view source on GitHub ↗
(model reflect.Value, fieldMap map[string]interface{})

Source from the content-addressed store, hash-verified

69}
70
71func removeDuplicateMapKeys(model reflect.Value, fieldMap map[string]interface{}) {
72 for i := 0; i < model.NumField(); i++ {
73 structField := model.Type().Field(i)
74
75 yamlTag := strings.Split(structField.Tag.Get("yaml"), ",")
76 yamlKey := yamlTag[0]
77
78 if yamlKey == "" {
79 yamlKey = structField.Name
80 }
81
82 delete(fieldMap, yamlKey)
83 }
84}

Callers 2

UnmarshalYAMLMethod · 0.85
UnmarshalYAMLMethod · 0.85

Calls 2

TypeMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected