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)
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)
A more interesting example showing that resizing can be observed (getting rid of the pointer to the slice, since it's not useful anyway):