Source file tour/moretypes/range-continued.go

     1  //go:build OMIT
     2  
     3  package main
     4  
     5  import "fmt"
     6  
     7  func main() {
     8  	pow := make([]int, 10)
     9  	for i := range pow {
    10  		pow[i] = 1 << uint(i) // == 2**i
    11  	}
    12  	for _, value := range pow {
    13  		fmt.Printf("%d\n", value)
    14  	}
    15  }
    16  

View as plain text