Replace gopkg.in/yaml.v3 with github.com/goccy/go-yaml

This commit is contained in:
M. Mert Yildiran
2023-09-21 21:36:08 +03:00
parent 78c89cc5b4
commit 2d17d1a83d
4 changed files with 10 additions and 5 deletions

View File

@@ -4,7 +4,7 @@ import (
"bytes"
"encoding/json"
"gopkg.in/yaml.v3"
"github.com/goccy/go-yaml"
)
func PrettyYaml(data interface{}) (result string, err error) {
@@ -21,8 +21,7 @@ func PrettyYaml(data interface{}) (result string, err error) {
}
buffer := new(bytes.Buffer)
encoder := yaml.NewEncoder(buffer)
encoder.SetIndent(2)
encoder := yaml.NewEncoder(buffer, yaml.Indent(2))
err = encoder.Encode(unmarshalled)
if err != nil {