From 0128075ced6ac25bb636551b048ea10596433520 Mon Sep 17 00:00:00 2001 From: "torben.diekmann" Date: Tue, 9 May 2023 11:05:57 +0200 Subject: [PATCH] marshals nil slices/arrays like expected and equivalent to json.marshal --- sheriff.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sheriff.go b/sheriff.go index 8ce11db..022a8d7 100644 --- a/sheriff.go +++ b/sheriff.go @@ -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 }