Answers for "iterate over iterator golang"

Go
0

iterate over iterator golang

func printEvenNumbers(max int) {
    iter := NewEvenNumberIterator(max)
    for iter.Next() {
        fmt.Printf("n: %d\n", iter.Value())
    }
    if iter.Err() != nil {
        log.Fatalf("error: %s\n", iter.Err())
    }
}
Posted by: Guest on February-19-2021

Code answers related to "iterate over iterator golang"

Browse Popular Code Answers by Language