(content []byte)
| 217 | } |
| 218 | |
| 219 | func normalizeContent(content []byte) ([]byte, error) { |
| 220 | // Unmarshal and marshal again content to normalize yaml structure |
| 221 | // This avoids style differences to show up as diffs but it can |
| 222 | // make the output different from the original template (since it is in normalized form) |
| 223 | var object map[interface{}]interface{} |
| 224 | if err := yaml.Unmarshal(content, &object); err != nil { |
| 225 | return nil, err |
| 226 | } |
| 227 | normalizedContent, err := yaml.Marshal(object) |
| 228 | if err != nil { |
| 229 | return nil, err |
| 230 | } |
| 231 | return normalizedContent, nil |
| 232 | } |
| 233 | |
| 234 | func isHook(metadata metadata, hooks ...string) bool { |
| 235 | for _, hook := range hooks { |
no outgoing calls