From 7bf201ab3c6961caa1e522d46aa5f72ff77f3e4c Mon Sep 17 00:00:00 2001 From: David Peleg Date: Mon, 26 Oct 2020 14:37:17 +0200 Subject: [PATCH] Update ungron.go: fix bug: merge json.Number type --- ungron.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ungron.go b/ungron.go index 453ada6..138188d 100644 --- a/ungron.go +++ b/ungron.go @@ -19,6 +19,7 @@ import ( "strings" "unicode" "unicode/utf8" + "reflect" "github.com/pkg/errors" ) @@ -456,12 +457,12 @@ func recursiveMerge(a, b interface{}) (interface{}, error) { } return recursiveSliceMerge(a.([]interface{}), bSlice) - case string, int, float64, bool, nil: + case string, int, float64, bool, nil, json.Number: // Can't merge them, second one wins return b, nil default: - return nil, fmt.Errorf("unexpected data type for merge") + return nil, fmt.Errorf("unexpected data type for merge: `%s`", reflect.TypeOf(a)) } }