func main(){ var array [10]int sliceA := array[0:5] append(sliceA, 4) fmt.Println(sliceA) }
Error : append(sliceA, 4
sliceA =append(sliceA, 4) append returns a slice containing one or more new values. Note that we need to accept a return value from append as we may get a new slice value.