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

Method Encode

internal/yaml/encode.go:11–21  ·  view source on GitHub ↗

Encode is a convenience function which will encode the given node to a byte slice.

()

Source from the content-addressed store, hash-verified

9// Encode is a convenience function which will encode the given node to a byte
10// slice.
11func (n *Node) Encode() ([]byte, error) {
12 // All this is really so we can set indentation to 2 spaces.
13 buf := &bytes.Buffer{}
14 enc := yaml.NewEncoder(buf)
15
16 enc.SetIndent(2)
17
18 err := enc.Encode(n.Node)
19
20 return buf.Bytes(), err
21}

Callers 2

ensureSampleConfigFunction · 0.80
ensureAdminUserFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected