/
yaml.go
34 lines (30 loc) · 998 Bytes
/
yaml.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package yqlib
type YamlPreferences struct {
Indent int
ColorsEnabled bool
LeadingContentPreProcessing bool
PrintDocSeparators bool
UnwrapScalar bool
EvaluateTogether bool
}
func NewDefaultYamlPreferences() YamlPreferences {
return YamlPreferences{
Indent: 2,
ColorsEnabled: false,
LeadingContentPreProcessing: true,
PrintDocSeparators: true,
UnwrapScalar: true,
EvaluateTogether: false,
}
}
func (p *YamlPreferences) Copy() YamlPreferences {
return YamlPreferences{
Indent: p.Indent,
ColorsEnabled: p.ColorsEnabled,
LeadingContentPreProcessing: p.LeadingContentPreProcessing,
PrintDocSeparators: p.PrintDocSeparators,
UnwrapScalar: p.UnwrapScalar,
EvaluateTogether: p.EvaluateTogether,
}
}
var ConfiguredYamlPreferences = NewDefaultYamlPreferences()