MCPcopy Create free account
hub / github.com/belak/gitdir / ensureSampleConfig

Function ensureSampleConfig

config_ensure.go:8–19  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

6)
7
8func 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
21func ensureSampleConfigYaml(data []byte) (*yaml.Node, bool, error) {
22 rootNode, targetNode, err := yaml.EnsureDocument(data)

Callers

nothing calls this directly

Calls 2

ensureSampleConfigYamlFunction · 0.85
EncodeMethod · 0.80

Tested by

no test coverage detected