Skip to content

Commit

Permalink
fix: decode error message
Browse files Browse the repository at this point in the history
  • Loading branch information
lll-lll-lll-lll authored and AlexVulaj committed May 4, 2024
1 parent 4548527 commit 7d1c58e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (d *Decoder) setDefaults(t reflect.Type, v reflect.Value) MultiError {
//this check is to handle if the wrong value is provided
convertedVal := builtinConverters[f.typ.Elem().Kind()](val)
if !convertedVal.IsValid() {
errs.merge(MultiError{"default-" + f.name: errors.New("some elements in the slice are of a different type.")})
errs.merge(MultiError{"default-" + f.name: fmt.Errorf("failed setting default: %s is not compatible with field %s type", val, f.name)})
break
}
defaultSlice = reflect.Append(defaultSlice, convertedVal)
Expand Down

0 comments on commit 7d1c58e

Please sign in to comment.