aboutsummaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2023-06-13 09:46:50 -0700
committerGopher Robot <gobot@golang.org>2023-06-14 17:09:34 +0000
commit0a48e5cbfabd679eecdec1efa731692cd6babf83 (patch)
tree50f1d76e401a530536c40af010459bc08fad0d69 /api
parent01b649b7ef45b89610a47efa048b8e73e76b078e (diff)
downloadgo-0a48e5cbfabd679eecdec1efa731692cd6babf83.tar.xz
slices: consistently use S ~[]E
Make all functions use a constraint S ~[]E even if they don't return the slice type. This makes explicitly instantiating the functions more consistent: you don't have to remember which take ~[]E and which do not. It also permits inferring the type when passing one of these functions to some other function that is using a named slice type. Fixes #60546 Change-Id: Ib3435255d0177fdbf03455ae527d08599b1ce012 Reviewed-on: https://go-review.googlesource.com/c/go/+/502955 Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Axel Wagner <axel.wagner.hh@googlemail.com> Reviewed-by: Eli Bendersky <eliben@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'api')
-rw-r--r--api/go1.21.txt40
1 files changed, 20 insertions, 20 deletions
diff --git a/api/go1.21.txt b/api/go1.21.txt
index 964392e0ec..6435d10914 100644
--- a/api/go1.21.txt
+++ b/api/go1.21.txt
@@ -365,35 +365,35 @@ pkg runtime, method (*Pinner) Pin(interface{}) #46787
pkg runtime, method (*Pinner) Unpin() #46787
pkg runtime, type PanicNilError struct #25448
pkg runtime, type Pinner struct #46787
-pkg slices, func BinarySearch[$0 cmp.Ordered]([]$0, $0) (int, bool) #60091
-pkg slices, func BinarySearchFunc[$0 interface{}, $1 interface{}]([]$0, $1, func($0, $1) int) (int, bool) #60091
+pkg slices, func BinarySearch[$0 interface{ ~[]$1 }, $1 cmp.Ordered]($0, $1) (int, bool) #60091
+pkg slices, func BinarySearchFunc[$0 interface{ ~[]$1 }, $1 interface{}, $2 interface{}]($0, $2, func($1, $2) int) (int, bool) #60091
pkg slices, func Clip[$0 interface{ ~[]$1 }, $1 interface{}]($0) $0 #57433
pkg slices, func Clone[$0 interface{ ~[]$1 }, $1 interface{}]($0) $0 #57433
pkg slices, func Compact[$0 interface{ ~[]$1 }, $1 comparable]($0) $0 #57433
pkg slices, func CompactFunc[$0 interface{ ~[]$1 }, $1 interface{}]($0, func($1, $1) bool) $0 #57433
-pkg slices, func Compare[$0 cmp.Ordered]([]$0, []$0) int #60091
-pkg slices, func CompareFunc[$0 interface{}, $1 interface{}]([]$0, []$1, func($0, $1) int) int #60091
-pkg slices, func Contains[$0 comparable]([]$0, $0) bool #57433
-pkg slices, func ContainsFunc[$0 interface{}]([]$0, func($0) bool) bool #57433
+pkg slices, func Compare[$0 interface{ ~[]$1 }, $1 cmp.Ordered]($0, $0) int #60091
+pkg slices, func CompareFunc[$0 interface{ ~[]$2 }, $1 interface{ ~[]$3 }, $2 interface{}, $3 interface{}]($0, $1, func($2, $3) int) int #60091
+pkg slices, func Contains[$0 interface{ ~[]$1 }, $1 comparable]($0, $1) bool #57433
+pkg slices, func ContainsFunc[$0 interface{ ~[]$1 }, $1 interface{}]($0, func($1) bool) bool #57433
pkg slices, func Delete[$0 interface{ ~[]$1 }, $1 interface{}]($0, int, int) $0 #57433
pkg slices, func DeleteFunc[$0 interface{ ~[]$1 }, $1 interface{}]($0, func($1) bool) $0 #54768
-pkg slices, func Equal[$0 comparable]([]$0, []$0) bool #57433
-pkg slices, func EqualFunc[$0 interface{}, $1 interface{}]([]$0, []$1, func($0, $1) bool) bool #57433
+pkg slices, func Equal[$0 interface{ ~[]$1 }, $1 comparable]($0, $0) bool #57433
+pkg slices, func EqualFunc[$0 interface{ ~[]$2 }, $1 interface{ ~[]$3 }, $2 interface{}, $3 interface{}]($0, $1, func($2, $3) bool) bool #57433
pkg slices, func Grow[$0 interface{ ~[]$1 }, $1 interface{}]($0, int) $0 #57433
-pkg slices, func Index[$0 comparable]([]$0, $0) int #57433
-pkg slices, func IndexFunc[$0 interface{}]([]$0, func($0) bool) int #57433
+pkg slices, func Index[$0 interface{ ~[]$1 }, $1 comparable]($0, $1) int #57433
+pkg slices, func IndexFunc[$0 interface{ ~[]$1 }, $1 interface{}]($0, func($1) bool) int #57433
pkg slices, func Insert[$0 interface{ ~[]$1 }, $1 interface{}]($0, int, ...$1) $0 #57433
-pkg slices, func IsSorted[$0 cmp.Ordered]([]$0) bool #60091
-pkg slices, func IsSortedFunc[$0 interface{}]([]$0, func($0, $0) int) bool #60091
-pkg slices, func Max[$0 cmp.Ordered]([]$0) $0 #60091
-pkg slices, func MaxFunc[$0 interface{}]([]$0, func($0, $0) int) $0 #60091
-pkg slices, func Min[$0 cmp.Ordered]([]$0) $0 #60091
-pkg slices, func MinFunc[$0 interface{}]([]$0, func($0, $0) int) $0 #60091
+pkg slices, func IsSorted[$0 interface{ ~[]$1 }, $1 cmp.Ordered]($0) bool #60091
+pkg slices, func IsSortedFunc[$0 interface{ ~[]$1 }, $1 interface{}]($0, func($1, $1) int) bool #60091
+pkg slices, func Max[$0 interface{ ~[]$1 }, $1 cmp.Ordered]($0) $1 #60091
+pkg slices, func MaxFunc[$0 interface{ ~[]$1 }, $1 interface{}]($0, func($1, $1) int) $1 #60091
+pkg slices, func Min[$0 interface{ ~[]$1 }, $1 cmp.Ordered]($0) $1 #60091
+pkg slices, func MinFunc[$0 interface{ ~[]$1 }, $1 interface{}]($0, func($1, $1) int) $1 #60091
pkg slices, func Replace[$0 interface{ ~[]$1 }, $1 interface{}]($0, int, int, ...$1) $0 #57433
-pkg slices, func Reverse[$0 interface{}]([]$0) #58565
-pkg slices, func Sort[$0 cmp.Ordered]([]$0) #60091
-pkg slices, func SortFunc[$0 interface{}]([]$0, func($0, $0) int) #60091
-pkg slices, func SortStableFunc[$0 interface{}]([]$0, func($0, $0) int) #60091
+pkg slices, func Reverse[$0 interface{ ~[]$1 }, $1 interface{}]($0) #58565
+pkg slices, func Sort[$0 interface{ ~[]$1 }, $1 cmp.Ordered]($0) #60091
+pkg slices, func SortFunc[$0 interface{ ~[]$1 }, $1 interface{}]($0, func($1, $1) int) #60091
+pkg slices, func SortStableFunc[$0 interface{ ~[]$1 }, $1 interface{}]($0, func($1, $1) int) #60091
pkg strings, func ContainsFunc(string, func(int32) bool) bool #54386
pkg sync, func OnceFunc(func()) func() #56102
pkg sync, func OnceValue[$0 interface{}](func() $0) func() $0 #56102