Commit 1c286e8dd3 for golang

commit 1c286e8dd3084fe29b91337b5475e61a16490c81
Author: Guido Iaquinti <guido.iaquinti@gmail.com>
Date:   Fri Nov 27 17:21:31 2026 +0000

    slices: correct Grow's nilness documentation

    Grow currently says it preserves the input's nilness. A nil slice has
    zero capacity, so a positive growth request returns an empty, non-nil
    slice with room for the requested elements. Document that Grow returns
    nil exactly when the input slice is nil and n is zero.

    Change-Id: If72bebca67c18dc510dae15bf22e53f49f434d36
    GitHub-Last-Rev: 91a27fb04ec72e5d7babe718fc2cead4bcbfe0d1
    GitHub-Pull-Request: golang/go#83439
    Reviewed-on: https://go-review.googlesource.com/c/go/+/867921
    Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
    Reviewed-by: David Chase <drchase@google.com>
    LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
    Auto-Submit: Ian Lance Taylor <iant@golang.org>
    Reviewed-by: Ian Lance Taylor <iant@golang.org>
    Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>

diff --git a/src/slices/slices.go b/src/slices/slices.go
index 4ac0e79ac5..6f2526f966 100644
--- a/src/slices/slices.go
+++ b/src/slices/slices.go
@@ -418,7 +418,7 @@ func CompactFunc[S ~[]E, E any](s S, eq func(E, E) bool) S {
 // another n elements. After Grow(n), at least n elements can be appended
 // to the slice without another allocation. If n is negative or too large to
 // allocate the memory, Grow panics.
-// The result preserves the nilness of s.
+// The result is nil if and only if s is nil and n is zero.
 func Grow[S ~[]E, E any](s S, n int) S {
 	if n < 0 {
 		panic("cannot be negative")