Original post

I have the following code snippet:

package main

type test struct {
        arr *[]int
        val int
}

func main() {
        a := test{arr: &[]int{1, 2, 3, 4, 5}, val: 21}
        *(a.arr)[2] = 656
}



and I am getting the following error:

./4.:13:10: invalid operation: a.arr[2] (type *[]int does not support indexing)

I am not able to understand, how to de-reference the slice pointer to modify the value.