forked from mirror/gjson
Merge pull request #226 from ifraixedes/if/fix-doc-map-method
Fix Map method documentation
This commit is contained in:
commit
5827eb3b24
3
gjson.go
3
gjson.go
|
@ -283,7 +283,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 {
|
func (t Result) Map() map[string]Result {
|
||||||
if t.Type != JSON {
|
if t.Type != JSON {
|
||||||
return map[string]Result{}
|
return map[string]Result{}
|
||||||
|
|
Loading…
Reference in New Issue