Skip to content

Commit

Permalink
Fix Map method documentation
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ifraixedes committed Jul 19, 2021
1 parent a5e52e5 commit 21a77fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gjson.go
Expand Up @@ -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{}
Expand Down

0 comments on commit 21a77fa

Please sign in to comment.