MCPcopy Create free account
hub / github.com/VirusTotal/vt-cli / NewEncoder

Function NewEncoder

yaml/yaml.go:76–89  ·  view source on GitHub ↗

NewEncoder returns a new YAML encoder that writes to w.

(w io.Writer, options ...EncoderOption)

Source from the content-addressed store, hash-verified

74
75// NewEncoder returns a new YAML encoder that writes to w.
76func NewEncoder(w io.Writer, options ...EncoderOption) *Encoder {
77 enc := &Encoder{w: w, indentSize: 2}
78 for _, opt := range options {
79 opt(enc)
80 }
81 if enc.Colors == nil {
82 enc.Colors = &Colors{
83 KeyColor: color.New(),
84 ValueColor: color.New(),
85 CommentColor: color.New(),
86 }
87 }
88 return enc
89}
90
91// lineBreakV decides whether or not a line break should be written based in
92// the type of v. It returns an indentation increment, a boolean indicating if

Callers 3

PrintMethod · 0.92
NewMetaCmdFunction · 0.92
TestYAMLFunction · 0.70

Calls

no outgoing calls

Tested by 1

TestYAMLFunction · 0.56