(model reflect.Value, fieldMap map[string]interface{})
| 69 | } |
| 70 | |
| 71 | func 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 | } |
no test coverage detected