767828262502eae89f139bd3fbfceae827cf16f5 — kotrunga 5 months ago 23b34f7
1.3.17 and starting 1.3.18
A basics/structs-slices-maps/1.3.17_range-continued.go => basics/structs-slices-maps/1.3.17_range-continued.go +26 -0
@@ 0,0 1,26 @@
+ /*
+ 	Notes 1.3.17
+ 
+ 	Remember, for a range, two values are returned:
+ 	  - the index
+ 	  - a copy of the element at that index
+ 
+ 	You can omit something being returned with an underscore '_'. (second example)
+ 	You can also omit the copy if you only want the index. (first example)
+ */
+ 
+ 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)
+ 	}
+ }< 
\ No newline at end of file

A basics/structs-slices-maps/1.3.18_exercise-slices.go => basics/structs-slices-maps/1.3.18_exercise-slices.go +10 -0
@@ 0,0 1,10 @@
+ /*
+ 	Notes 1.3.18
+ 
+ 	Remember, for a range, two values are returned:
+ 	  - the index
+ 	  - a copy of the element at that index
+ 
+ 	You can omit something being returned with an underscore '_'. (second example)
+ 	You can also omit the copy if you only want the index. (first example)
+ */< 
\ No newline at end of file