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 May 9, 2023
1 parent cd01545 commit 0128075
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 @@ -218,7 +218,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 0128075

Please sign in to comment.