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.
This commit is contained in:
Ivan Fraixedes 2021-07-19 10:56:18 +02:00
parent a5e52e5b06
commit 21a77fab7d
No known key found for this signature in database
GPG Key ID: 042B474597F96DB7
1 changed files with 2 additions and 1 deletions

View File

@ -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{}