GitBucket
4.23.0
Toggle navigation
Sign in
Files
Branches
1
Releases
Issues
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
sample-golang
/
01_hello
Browse code
Delete append.go~
master
1 parent
a523d71
commit
13f2d51ec05682030b39aa7aced83c13c2a162f0
yhornisse
authored
on 24 Sep 2021
Patch
Showing
1 changed file
array/append.go~
Show notes
View
array/append.go~
100644 → 0
package main import "fmt" func main() { ary := []int{} for i := 0; i < 10; i++ { ary = append(ary, i) fmt.Printf("%d: %p cap:%d %v\n", i, ary, cap(ary), ary) } /* 0: 0x14000134008 cap:1 [0] 1: 0x14000134030 cap:2 [0 1] 2: 0x1400013a020 cap:4 [0 1 2] 3: 0x1400013a020 cap:4 [0 1 2 3] 4: 0x1400012c080 cap:8 [0 1 2 3 4] 5: 0x1400012c080 cap:8 [0 1 2 3 4 5] 6: 0x1400012c080 cap:8 [0 1 2 3 4 5 6] 7: 0x1400012c080 cap:8 [0 1 2 3 4 5 6 7] 8: 0x1400013c000 cap:16 [0 1 2 3 4 5 6 7 8] 9: 0x1400013c000 cap:16 [0 1 2 3 4 5 6 7 8 9] */ }
Show line notes below