1
0
mirror of https://github.com/golang/go synced 2024-11-15 04:40:28 -07:00

slices: update doc for Repeat

To use (len(x) * count) consistently.

Change-Id: I45fa4383de7e05846152a8090ea5c04bc72a1727
Reviewed-on: https://go-review.googlesource.com/c/go/+/575955
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
This commit is contained in:
Jes Cok 2024-04-03 12:18:14 +08:00 committed by Gopher Robot
parent 23fc917060
commit 4b2db7f60d

View File

@ -477,7 +477,7 @@ func Concat[S ~[]E, E any](slices ...S) S {
}
// Repeat returns a new slice that repeats the provided slice the given number of times.
// The result has length and capacity len(x) * count.
// The result has length and capacity (len(x) * count).
// The result is never nil.
// Repeat panics if count is negative or if the result of (len(x) * count)
// overflows.