go-tour/range-continued.go
2020-02-04 21:44:36 -06:00

14 lines
215 B
Go

package main
import "fmt"
func main() {
pow := make([]int, 10)
for i := range pow {
pow[i] = 1 << uint(i) // == 2**i
}
for _, value := range pow {
fmt.Printf("%d\n", value)
}
}