spec: clarify the difference between &T{} and new(T)
Add a small paragraph and example pointing out the difference for the case where T is a slice or map. This is a common error for Go novices. Fixes #29425. Change-Id: Icdb59f25361e9f6a09b190fbfcc9ae0c7d90077b Reviewed-on: https://go-review.googlesource.com/c/go/+/176338Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Showing
Please register or sign in to comment