func foo(arr interface{})
foo(&arrayToChange)
Then I find that, I cannot change the array by pointer a simple example for you.
package main
import (
"fmt"
)
func A(out interface{}) {
arr := make([]interface{}, 0)
arr = append(arr, "foo", 2.2)
out = &arr
B(out)
}
func B(out interface{}) {
arr := make([]interface{}, 0)
arr = append(arr, "bar", "foo", "anything")
out = &arr
}
func main() {
arr := make([]interface{}, 0)
arr = append(arr, 1, 2, 3)
fmt.Printf("%T
", &arr)
A(&arr)
fmt.Println(arr)
}