go-concurrency-talk/figures/figure-8.go

9 lines
178 B
Go
Raw Normal View History

2020-06-05 19:39:30 +00:00
for i := 17; i <= 21; i++ { // write
- go func() { // HL
+ go func(i int) { // HL
apiVersion := fmt.Sprintf("v1.%d", i)
- }() // HL
+ }(i) // HL
}