You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when i use append to array multiple and change one array item i see change two array!
var s []int
s1:=append(s,1)
s2:=append(s1,2)
s3:=append(s2,3)
s4:=append(s3,4)
s5:=append(s4,6)
s6:=append(s5,5)
s6[1]=8
Unlike many projects on GitHub, the Go project does not use its bug tracker for general discussion or asking questions. We only use our bug tracker for tracking bugs and tracking proposals going through the Proposal Process.
go env
Outputwhen i use append to array multiple and change one array item i see change two array!
var s []int
s1:=append(s,1)
s2:=append(s1,2)
s3:=append(s2,3)
s4:=append(s3,4)
s5:=append(s4,6)
s6:=append(s5,5)
s6[1]=8
output is:
[1] [1 2] [1 2 3] [1 2 3 4] [1 8 3 4 6] [1 8 3 4 6 5]
i change s6 but change s6 and s5!
The text was updated successfully, but these errors were encountered: