(data []byte)
| 6 | ) |
| 7 | |
| 8 | func ensureSampleConfig(data []byte) ([]byte, error) { |
| 9 | rootNode, modified, err := ensureSampleConfigYaml(data) |
| 10 | if err != nil { |
| 11 | return nil, err |
| 12 | } |
| 13 | |
| 14 | if !modified { |
| 15 | return data, nil |
| 16 | } |
| 17 | |
| 18 | return rootNode.Encode() |
| 19 | } |
| 20 | |
| 21 | func ensureSampleConfigYaml(data []byte) (*yaml.Node, bool, error) { |
| 22 | rootNode, targetNode, err := yaml.EnsureDocument(data) |
nothing calls this directly
no test coverage detected