mirror of
https://github.com/mikefarah/yq.git
synced 2026-07-05 03:45:41 +00:00
Update pkg/yqlib/encoder_toml.go
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
This commit is contained in:
parent
b8d90fd574
commit
4d620bfa26
@ -34,10 +34,9 @@ func (te *tomlEncoder) Encode(writer io.Writer, node *CandidateNode) error {
|
|||||||
// Encode to a buffer first if colors are enabled
|
// Encode to a buffer first if colors are enabled
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
var targetWriter io.Writer
|
var targetWriter io.Writer
|
||||||
|
targetWriter = writer
|
||||||
if te.prefs.ColorsEnabled {
|
if te.prefs.ColorsEnabled {
|
||||||
targetWriter = &buf
|
targetWriter = &buf
|
||||||
} else {
|
|
||||||
targetWriter = writer
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Encode a root mapping as a sequence of attributes, tables, and arrays of tables
|
// Encode a root mapping as a sequence of attributes, tables, and arrays of tables
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user