]> git.feebdaed.xyz Git - 0xmirror/go.git/commit
spec: more precise prose for built-in function new
authorRobert Griesemer <gri@google.com>
Thu, 20 Nov 2025 22:05:27 +0000 (14:05 -0800)
committerGopher Robot <gobot@golang.org>
Tue, 2 Dec 2025 18:02:53 +0000 (10:02 -0800)
commit8ae5d408ed62d234cb72adebb9a23e08da1cedc6
treea20e1556d003c0edfc8271101e1f94b591f130ac
parentc5c05a0e43d062a89fc8d4172d3c043617d9dd81
spec: more precise prose for built-in function new

1) explain new(type) (simpler) before new(expr) (more complicated)
2) for new(expr), explain what happens when expr is an untyped bool
3) explain that new(nil) is not permitted
4) streamline examples slightly

Fixes #76122.

Change-Id: I5ddb26bd88241b4b2b9aa9b532a62f7861c2341c
Reviewed-on: https://go-review.googlesource.com/c/go/+/722482
Auto-Submit: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Commit-Queue: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
doc/go_spec.html