From 5241d114f55cfa69a4bf8f2051f5d83d1f618859 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Fri, 7 Nov 2025 19:52:27 -0800 Subject: [PATCH] spec: more precise prose for special case of append As written, the special case for append may be interpreted such that any first argument that is assignable to []byte is permissible, including nil. This change makes makes it clear that a slice argument is required. Not a language change. The compiler always expected a slice argument. Fixes #76226. Change-Id: I73a1725d10096690335d6edf5793beb5de73578f Reviewed-on: https://go-review.googlesource.com/c/go/+/718880 Reviewed-by: Junyang Shao Reviewed-by: Alan Donovan Reviewed-by: Robert Griesemer LUCI-TryBot-Result: Go LUCI Auto-Submit: Robert Griesemer Reviewed-by: Ian Lance Taylor --- doc/go_spec.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/go_spec.html b/doc/go_spec.html index d6c7962a961..514f60007b6 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -7383,8 +7383,8 @@ The values x are passed to a parameter of type ...E where E is the element type of S and the respective parameter passing rules apply. -As a special case, append also accepts a first argument assignable -to type []byte with a second argument of string type followed by +As a special case, append also accepts a slice whose type is assignable to +type []byte with a second argument of string type followed by .... This form appends the bytes of the string.