Skip to content

Commit 7d4fc15

Browse files
TorbenCKmweibel
authored andcommitted
marshals nil slices/arrays like expected and equivalent to json.marshal
1 parent 44f66ae commit 7d4fc15

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sheriff.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ func marshalValue(options *Options, v reflect.Value) (interface{}, error) {
218218
k := v.Kind()
219219

220220
switch k {
221-
case reflect.Interface, reflect.Map, reflect.Ptr:
221+
case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:
222222
if v.IsNil() {
223223
return val, nil
224224
}

0 commit comments

Comments
 (0)