(m *manifest.MappingResult)
| 85 | } |
| 86 | |
| 87 | func manifestToJSON(m *manifest.MappingResult) ([]byte, map[string]interface{}, error) { |
| 88 | if m == nil || strings.TrimSpace(m.Content) == "" { |
| 89 | return nil, nil, nil |
| 90 | } |
| 91 | jsonBytes, err := yaml.YAMLToJSON([]byte(m.Content)) |
| 92 | if err != nil { |
| 93 | return nil, nil, err |
| 94 | } |
| 95 | |
| 96 | if len(jsonBytes) == 0 || string(jsonBytes) == "null" { |
| 97 | return jsonBytes, nil, nil |
| 98 | } |
| 99 | |
| 100 | var obj map[string]interface{} |
| 101 | if err := json.Unmarshal(jsonBytes, &obj); err != nil { |
| 102 | return nil, nil, err |
| 103 | } |
| 104 | |
| 105 | return jsonBytes, obj, nil |
| 106 | } |
| 107 | |
| 108 | func (e *StructuredEntry) populateMetadata(key string, objects ...map[string]interface{}) { |
| 109 | for _, obj := range objects { |
no outgoing calls
no test coverage detected