Skip to content

Commit 0b85f37

Browse files
authored
Merge pull request #2829 from jandubois/yaml-fix
Remove custom YAML marshaller
2 parents 8343c5f + 5d6e39b commit 0b85f37

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

pkg/limayaml/marshal.go

+1-10
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,14 @@ import (
88
"github.com/sirupsen/logrus"
99
)
1010

11-
func marshalString(s string) ([]byte, error) {
12-
if s == "null" || s == "~" {
13-
// work around go-yaml bugs
14-
return []byte("\"" + s + "\""), nil
15-
}
16-
return yaml.Marshal(s)
17-
}
18-
1911
const (
2012
documentStart = "---\n"
2113
documentEnd = "...\n"
2214
)
2315

2416
// Marshal the struct as a YAML document, optionally as a stream.
2517
func Marshal(y *LimaYAML, stream bool) ([]byte, error) {
26-
options := []yaml.EncodeOption{yaml.CustomMarshaler[string](marshalString)}
27-
b, err := yaml.MarshalWithOptions(y, options...)
18+
b, err := yaml.Marshal(y)
2819
if err != nil {
2920
return nil, err
3021
}

0 commit comments

Comments
 (0)