I numbered your examples 1-5 and I will go through them here. Hope this helps!
var strArr0 *[10]string = new([10]string)
Here a new array of strings of length 10 is highlighted and returns a pointer to the array.
var strArr1 = new([10]string)
This is exactly the same as 1. This is just a shorthand that works due to output like Go. It can be shortened further:
strArr1 := new([10]string)
Where 1, 2, 2a all produce exactly the same result.
var strArr2 = make([]string,10)
10. . golang:
make() , , .
make([]T, length, capacity)
, , :
make([]int, 50, 100)
new([100]int)[0:50]
, 3 :
var strArr2 = new([10]string)[0:10]
var strArr2 []string = new([10]string)[0:10]
strArr2 := new([10]string)[0:10]
new make , . make , . , , make , .
, :
var strArr3 [10]string
, 1, 2 2a.
strArr4 := make([]string,10)
, 3.: = .
? , , , , . , :
foo := bar.ToStringArray()
, , :
var foo []string = bar.DoSomethingOpaque()
, - , .