aboutsummaryrefslogtreecommitdiffhomepage
path: root/testdata/go1.23/main.go
blob: 01782d235ea9e13912fbb175676256fa076e8f07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package main

func main() {
	testFuncRange(counter)
}

func testFuncRange(f func(yield func(int) bool)) {
	for i := range f {
		println(i)
	}
	println("go1.23 has lift-off!")
}

func counter(yield func(int) bool) {
	for i := 10; i >= 1; i-- {
		yield(i)
	}
}