We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8343c5f + 5d6e39b commit 0b85f37Copy full SHA for 0b85f37
pkg/limayaml/marshal.go
@@ -8,23 +8,14 @@ import (
8
"github.com/sirupsen/logrus"
9
)
10
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
-
19
const (
20
documentStart = "---\n"
21
documentEnd = "...\n"
22
23
24
// Marshal the struct as a YAML document, optionally as a stream.
25
func Marshal(y *LimaYAML, stream bool) ([]byte, error) {
26
- options := []yaml.EncodeOption{yaml.CustomMarshaler[string](marshalString)}
27
- b, err := yaml.MarshalWithOptions(y, options...)
+ b, err := yaml.Marshal(y)
28
if err != nil {
29
return nil, err
30
}
0 commit comments