commit | eebb9db0ef1a4cad2f5dd7e8b90f699a1d50bf91 | [log] [tgz] |
---|---|---|
author | Robert Griesemer <gri@golang.org> | Thu May 09 17:35:29 2019 -0700 |
committer | Robert Griesemer <gri@golang.org> | Mon May 13 21:24:51 2019 +0000 |
tree | 12b3f805e55daa9223c69e8bcfbf0832d1e4f9ed | |
parent | 451cf3e2cd8950571f436896a3987343f8c2d7f6 [diff] |
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>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.