Variables of all types require the use of a pointer, if you wish to modify the value passed to a function.
The only exception is that some reference types may have their members modified without passing a pointer, but the type value cannot be modified without using a pointer.
Example of modifying a slice member (but not the slice itself) (playground):
func main() {
s := []int{1, 2, 3, 4}
modifySliceMember(s)
fmt.Println(s) // [90 2 3 4]
}
func modifySliceMember(s []int) {
if len(s) > 0 {
s[0] = 99
}
}
To modify the slice itself (playground):
func main() {
s := []int{1, 2, 3, 4}
modifySlice(&s)
fmt.Println(s) // []
}
func modifySlice(s *[]int) {
*s = make([]int, 0)
}
However, note that even in this case, we're not really changing the passed value strictly speaking. The passed value in this case is a pointer, and that pointer cannot be changed.