I got this error "Cannot take the address of the result of append" when I try to :
s := []int{1, 2}
temp := &s
temp = &append(*temp, 3)
but if I make minor change like this:
s := []int{1, 2}
temp := &s
temp2 := append(*temp, 3)
temp = &temp2
there is no error.
I was navigated to this issue, but I can't understand it's comments.
Can anyone explain the differences?