Skip to content

Commit

Permalink
marshals nil slices/arrays like expected and equivalent to json.marshal
Browse files Browse the repository at this point in the history
  • Loading branch information
TorbenCK authored and mweibel committed Mar 6, 2024
1 parent 3d33d00 commit 70d8bb7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sheriff.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func marshalValue(options *Options, v reflect.Value) (interface{}, error) {
k := v.Kind()

switch k {
case reflect.Interface, reflect.Map, reflect.Ptr:
case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:
if v.IsNil() {
return val, nil
}
Expand Down

0 comments on commit 70d8bb7

Please sign in to comment.