Original post

The zerovalue for []Type is nil, so no allocation necessary before you actually create a non-zero value.

Also var a []int is not equivalent to a := []int{} as the latter should already initialise with a non-zero value.