]> Cypherpunks repositories - gostls13.git/commit
spec: clarify the difference between &T{} and new(T)
authorRobert Griesemer <gri@golang.org>
Fri, 10 May 2019 00:35:29 +0000 (17:35 -0700)
committerRobert Griesemer <gri@golang.org>
Mon, 13 May 2019 21:24:51 +0000 (21:24 +0000)
commiteebb9db0ef1a4cad2f5dd7e8b90f699a1d50bf91
tree12b3f805e55daa9223c69e8bcfbf0832d1e4f9ed
parent451cf3e2cd8950571f436896a3987343f8c2d7f6
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/+/176338
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
doc/go_spec.html