In the Go Tour exercise #17, I don't understand this expression 1 << uint(i)
package main
import "fmt"
func main() {
pow := make([]int, 10)
for i := range pow {
pow[i] = 1 << uint(i)
}
for _, value := range pow {
fmt.Printf("%d\n", value)
}
}
What is the purpose of this operator ? <<
The program outputs:
1
2
4
8
16
32
64
128
256
512
Program exited.