Merge pull request #226 from ifraixedes/if/fix-doc-map-method

Fix Map method documentation
This commit is contained in:
Josh Baker 2021-09-01 07:27:29 -07:00 committed by GitHub
commit 5827eb3b24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

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