Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
linting
  • Loading branch information
Emyrk committed Jan 16, 2024
commit 1ea9a8ba4f6f8af775ae3c203f9006d84df2384c
18 changes: 9 additions & 9 deletions cli/clibase/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,24 @@ func (i *Validator[T]) Type() string {
return i.Value.Type()
}

func (u *Validator[T]) MarshalYAML() (interface{}, error) {
m, ok := any(u.Value).(yaml.Marshaler)
func (i *Validator[T]) MarshalYAML() (interface{}, error) {
m, ok := any(i.Value).(yaml.Marshaler)
if !ok {
return u.Value, nil
return i.Value, nil
}
return m.MarshalYAML()
}

func (u *Validator[T]) UnmarshalYAML(n *yaml.Node) error {
return n.Decode(u.Value)
func (i *Validator[T]) UnmarshalYAML(n *yaml.Node) error {
return n.Decode(i.Value)
}

func (u *Validator[T]) MarshalJSON() ([]byte, error) {
return json.Marshal(u.Value)
func (i *Validator[T]) MarshalJSON() ([]byte, error) {
return json.Marshal(i.Value)
}

func (u *Validator[T]) UnmarshalJSON(b []byte) error {
return json.Unmarshal(b, u.Value)
func (i *Validator[T]) UnmarshalJSON(b []byte) error {
return json.Unmarshal(b, i.Value)
}

func (*Validator[T]) IsValidator() {}
Expand Down