From 827b3fc1b78eae84e27cc07ef946b312f0547afd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Wed, 7 Jun 2023 17:45:45 +0200 Subject: [PATCH] v0.0.149 --- goextVersion.go | 4 ++-- reflectext/primitiveStringSerializer.go | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/goextVersion.go b/goextVersion.go index a0d1075..c5426ff 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ package goext -const GoextVersion = "0.0.148" +const GoextVersion = "0.0.149" -const GoextVersionTimestamp = "2023-06-07T17:22:38+0200" +const GoextVersionTimestamp = "2023-06-07T17:45:45+0200" diff --git a/reflectext/primitiveStringSerializer.go b/reflectext/primitiveStringSerializer.go index 157c90d..16b9f90 100644 --- a/reflectext/primitiveStringSerializer.go +++ b/reflectext/primitiveStringSerializer.go @@ -46,10 +46,14 @@ func (pss PrimitiveStringSerializer) ValueToString(v any) (string, error) { func (pss PrimitiveStringSerializer) ValueFromString(str string, outType reflect.Type) (any, error) { - if str == "" { + if outType.Kind() == reflect.Ptr && str == "" { return reflect.Zero(outType).Interface(), nil // = nil.(outType), nil } + if str == "" { + return reflect.Zero(outType).Interface(), nil // = (outType), nil + } + if outType.Kind() == reflect.Ptr { innerValue, err := pss.ValueFromString(str, outType.Elem())