MCPcopy
hub / github.com/go-yaml/yaml / SetIndent

Method SetIndent

yaml.go:274–279  ·  view source on GitHub ↗

SetIndent changes the used indentation used when encoding.

(spaces int)

Source from the content-addressed store, hash-verified

272
273// SetIndent changes the used indentation used when encoding.
274func (e *Encoder) SetIndent(spaces int) {
275 if spaces < 0 {
276 panic("yaml: cannot indent to a negative number of spaces")
277 }
278 e.encoder.indent = spaces
279}
280
281// Close closes the encoder by writing any remaining data.
282// It does not write a stream terminating string "...".

Callers 3

TestSetIndentMethod · 0.95
TestNodeRoundtripMethod · 0.95
TestSetStringMethod · 0.95

Calls

no outgoing calls

Tested by 3

TestSetIndentMethod · 0.76
TestNodeRoundtripMethod · 0.76
TestSetStringMethod · 0.76