content: add comment about << in range example
The 'Range Continued' code example uses a left shift operator.
Some people are unfamiliar with shift, and being puzzled about
what it means can distract from the point--which is range.
Per a suggestion from gri, this adds a small comment to show that
it's equivalent to 2**n.
Fixes golang/go#14241
Change-Id: If0bcfad85390db96f9f9c4295dc18f34410cb494
Reviewed-on: https://go-review.googlesource.com/19291
Reviewed-by: Robert Griesemer <gri@golang.org>
diff --git a/content/moretypes/range-continued.go b/content/moretypes/range-continued.go
index 86a8a8b..feae06b 100644
--- a/content/moretypes/range-continued.go
+++ b/content/moretypes/range-continued.go
@@ -7,7 +7,7 @@
func main() {
pow := make([]int, 10)
for i := range pow {
- pow[i] = 1 << uint(i)
+ pow[i] = 1 << uint(i) // == 2**i
}
for _, value := range pow {
fmt.Printf("%d\n", value)