I am currently going through the GoLang tutorials and have the following doubt.
arr1:=[...]int{1,2,3}
arr2:=arr1
arr1[1]=99
fmt.Println(arr1)
fmt.Println(arr2)
it outputs the following statements
[1 99 3]
[1 2 3]
here only array a is modified, which makes sense as an array is treated as values.
if I try following things get confusing
a:=[...]int{1,2,3}
b:=a[:]
a[1]=88
fmt.Println(a)
fmt.Println(b)
this results in printing
[1 88 3]
[1 88 3]
Question: does this mean saying b:=a creates a copy of the array and saying b:=a[:] will create a slice that will point to the underlying array ('a' in this case)?