Created
March 31, 2013 10:33
-
-
Save kicool/5280237 to your computer and use it in GitHub Desktop.
Revisions
-
kicool created this gist
Mar 31, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ package main import "fmt" func main() { a := make([]int, 1, 100) a[0] = 10 fmt.Printf("a:%v, &a[0] %p, &a %p\n\n", a, &a[0], &a) b := append(a, 20) fmt.Printf("a:%v, &a[0] %p, &a %p\n", a, &a[0], &a) fmt.Printf("b:%v, &b[0] %p, &b %p\n\n", b, &b[0], &b) c := append(a, 30) fmt.Printf("a:%v, &a[0] %p, &a %p\n", a, &a[0], &a) fmt.Printf("b:%v, &b[0] %p, &b %p\n", b, &b[0], &b) fmt.Printf("c:%v, &c[0] %p, &c %p\n", c, &c[0], &c) }