From 004e2a23388d5621c1362672e94f8adb8b33bd67 Mon Sep 17 00:00:00 2001 From: roeldev Date: Sun, 7 Apr 2024 12:13:04 +0200 Subject: [PATCH] Remove unneeded ptr resolvement --- decode.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/decode.go b/decode.go index 7600839..4326dc6 100644 --- a/decode.go +++ b/decode.go @@ -106,7 +106,7 @@ func (d *Decoder) Decode(v any) error { if rv.Kind() != reflect.Ptr || rv.IsNil() { return errors.New(ErrStructPointerExpected) } - if underlyingKind(rv.Type()) != reflect.Struct { + if underlyingKind(rv.Elem().Type()) != reflect.Struct { return errors.New(ErrStructPointerExpected) }