Skip to content

Commit

Permalink
fix: line break for windows
Browse files Browse the repository at this point in the history
Signed-off-by: jakezhu9 <[email protected]>
  • Loading branch information
jakezhu9 committed Dec 8, 2023
1 parent fbcceb4 commit 1068c18
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/tools/gen/genkcl_yaml.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package gen

import (
"github.com/goccy/go-yaml"
"bytes"
"io"

"github.com/goccy/go-yaml"
)

func (k *kclGenerator) genKclFromYaml(w io.Writer, filename string, src interface{}) error {
Expand All @@ -11,6 +13,8 @@ func (k *kclGenerator) genKclFromYaml(w io.Writer, filename string, src interfac
return err
}

code = bytes.ReplaceAll(code, []byte("\r\n"), []byte("\n"))

yamlData := &yaml.MapSlice{}
if err = yaml.UnmarshalWithOptions(code, yamlData, yaml.UseOrderedMap()); err != nil {
return err
Expand Down

0 comments on commit 1068c18

Please sign in to comment.