☰
Debian Codegraph
@
0.16.1+git20260209.fcb76d1-2
0.16.1+git20260209.fcb76d1-1
/
/
_test
/
closure11.go
☽
☼
_test/closure11.go
code
plain
raw
symbols
SCIP
Apache-2.0
2019 Containous SAS; 2020 Traefik Labs SAS
debian/copyright
1
package
main
2
3
type
T
struct
{
4
F
func
()
5
}
6
7
func
main() {
8
foos := []
T
{}
9
10
for
i :=
0
; i <
3
; i++ {
11
a := i
12
foos = append(foos,
T
{
func
() { println(i, a) }})
13
}
14
foos[
0
].
F
()
15
foos[
1
].
F
()
16
foos[
2
].
F
()
17
}
18
19
// Output:
20
// 0 0
21
// 1 1
22
// 2 2