|
|
|
|
|
by leaveyou
1751 days ago
|
|
append(ref, 4) // error: first argument to append must be slice append(*ref, 4) // error: append(*ref, 4) evaluated but not used this is the correct version and it also removes the incertitude: *ref = append(*ref, 4) https://play.golang.org/p/-xDqaxvqWhm |
|
A more interesting example showing that resizing can be observed (getting rid of the pointer to the slice, since it's not useful anyway):
https://play.golang.org/p/UJ-t63bKyJJ