switch yaml package to maintained one
All checks were successful
coverage / build (push) Successful in 2m16s
test / test (push) Successful in 4m37s
sync / sync (push) Successful in 8s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2025-05-09 12:18:49 +03:00
parent 03ee33040c
commit 88a5875cfb
6 changed files with 12 additions and 13 deletions

View File

@@ -6,7 +6,7 @@ import (
"strconv"
"time"
"gopkg.in/yaml.v3"
"github.com/goccy/go-yaml"
)
type Duration int64
@@ -58,9 +58,9 @@ func (d Duration) MarshalYAML() (interface{}, error) {
return time.Duration(d).String(), nil
}
func (d *Duration) UnmarshalYAML(n *yaml.Node) error {
func (d *Duration) UnmarshalYAML(data []byte) error {
var v interface{}
if err := yaml.Unmarshal([]byte(n.Value), &v); err != nil {
if err := yaml.Unmarshal(data, &v); err != nil {
return err
}
switch value := v.(type) {

View File

@@ -6,7 +6,7 @@ import (
"testing"
"time"
"gopkg.in/yaml.v3"
"github.com/goccy/go-yaml"
)
func TestMarshalYAML(t *testing.T) {