Skip to content

Commit

Permalink
strint: return conversion error
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Feb 3, 2025
1 parent 10968e0 commit 8e2315e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/types/strint.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ func (s *StrInt64) UnmarshalYAML(unmarshal func(a interface{}) error) (err error

var ss string
if err = unmarshal(&ss); err == nil {
s2, err := NewStrInt64FromString(ss)
if err != nil {
return err
s2, err2 := NewStrInt64FromString(ss)
if err2 != nil {
return err2
}

*s = s2
return
}

return fmt.Errorf("StrInt64.UnmarshalYAML error: unsupported value type, not int64 or string")
return fmt.Errorf("StrInt64.UnmarshalYAML error: unsupported value type, not int64 or string: %w", err)
}

func (s *StrInt64) MarshalJSON() ([]byte, error) {
Expand Down

0 comments on commit 8e2315e

Please sign in to comment.