Skip to content

Commit

Permalink
bugfix: options were not preserved for pointer types during unpack (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
muir committed Apr 15, 2022
1 parent 38ab121 commit a23e455
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion unpack.go
Expand Up @@ -110,7 +110,7 @@ func MakeStringSetter(t reflect.Type, optArgs ...StringSetterArg) (func(target r
}
switch t.Kind() {
case reflect.Ptr:
setElem, err := MakeStringSetter(t.Elem())
setElem, err := MakeStringSetter(t.Elem(), optArgs...)
if err != nil {
return nil, err
}
Expand Down
1 change: 1 addition & 0 deletions unpack_test.go
Expand Up @@ -88,6 +88,7 @@ func TestStringSetter(t *testing.T) {
SA3 [2]string `value:"foo,bar" want:"[foo,bar ]" split:""`
SS5 []string `value:"foo" want:"[foo bar]" value2:"bar"`
SS6 []string `value:"foo" want:"[bar]" value2:"bar" sa:"f"`
RG01 *[]int `value:"823:29" want:"[823 29]" split:":"`
}
var ts tsType
vp := reflect.ValueOf(&ts)
Expand Down

0 comments on commit a23e455

Please sign in to comment.