File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ package main
6
6
7
7
// Number of elements to grow each stack frame.
8
8
// Run with 10 and then with 1024
9
- const size = 10
9
+ const size = 1024
10
10
11
11
// main is the entry point for the application.
12
12
func main () {
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ https://github.com/golang/go/wiki/SliceTricks
27
27
[ Reference Types] ( example2/example2.go ) ([ Go Playground] ( https://play.golang.org/p/gVWb35XjwM ) )
28
28
[ Appending slices] ( example4/example4.go ) ([ Go Playground] ( https://play.golang.org/p/xiI54S0bSN ) )
29
29
[ Taking slices of slices] ( example3/example3.go ) ([ Go Playground] ( https://play.golang.org/p/Okc2EZG5_M ) )
30
- [ Slices and References] ( example5/example5.go ) ([ Go Playground] ( https://play.golang.org/p/q0ZHf3Yoln ) )
30
+ [ Slices and References] ( example5/example5.go ) ([ Go Playground] ( https://play.golang.org/p/zYT3ls_DuV ) )
31
31
[ Strings and slices] ( example6/example6.go ) ([ Go Playground] ( https://play.golang.org/p/x0Q5ByzxGS ) )
32
32
[ Variadic functions] ( example7/example7.go ) ([ Go Playground] ( https://play.golang.org/p/aTGRT1rhoO ) )
33
33
Original file line number Diff line number Diff line change @@ -12,14 +12,14 @@ func main() {
12
12
// Declare a slice of integers with 7 values.
13
13
x := make ([]int , 7 )
14
14
15
- // Set a pointer to the second element of the slice.
16
- twohundred := & x [1 ]
17
-
18
15
// Random starting counters.
19
16
for i := 0 ; i < 7 ; i ++ {
20
17
x [i ] = i * 100
21
18
}
22
19
20
+ // Set a pointer to the second element of the slice.
21
+ twohundred := & x [1 ]
22
+
23
23
// Append a new value to the slice.
24
24
x = append (x , 800 )
25
25
You can’t perform that action at this time.
0 commit comments