|
No, ps still points to s: https://play.golang.org/p/iSjoqGTg20_O var s []int
s = append(s, 10, 20, 30)
pe := &s[0]
ps := &s
s = append(s, 50)
s[0] = 100
pe2 := &s[0]
fmt.Println("s: ", s, ", ps: ", ps, ", pe: ", pe, ", pe2: ", pe2)
// s: [100 20 30 50] , ps: &[100 20 30 50] , pe: 0xc0000be000 , pe2: 0xc0000b8030
|
Is that still true in an app that has considerable memory pressure and has GC running now and then?