From 21a77fab7dfe6de7259c28dc49cc08e2b4f6c9b2 Mon Sep 17 00:00:00 2001 From: Ivan Fraixedes Date: Mon, 19 Jul 2021 10:56:18 +0200 Subject: [PATCH] Fix Map method documentation Fix a typo in the Map method documentation and describes what it returns when the value isn't JSON to look like the Array method documentation. --- gjson.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gjson.go b/gjson.go index 8e6c099..0d59845 100644 --- a/gjson.go +++ b/gjson.go @@ -281,7 +281,8 @@ func (t Result) ForEach(iterator func(key, value Result) bool) { } } -// Map returns back an map of values. The result should be a JSON array. +// Map returns back a map of values. The result should be a JSON object. +// If the result is not a JSON object, the return value will be an empty map. func (t Result) Map() map[string]Result { if t.Type != JSON { return map[string]Result{}