Standard library / reflect
reflect.MapIter.Next()
Advances to the next map entry and reports whether one exists. Stop calling Next after false. Expected stdout: 'true false\n'.
Formal Syntax & Structure
go syntaxgo
func (iter *MapIter) Next() boolReturn Value
bool
Advances to the next map entry and reports whether one exists.
Working Example
Example Snippetgo
package main
import ( "fmt" "reflect")
func main() { m := reflect.ValueOf(map[string]int{"a": 7}) it := m.MapRange() fmt.Println(it.Next(), it.Next())}