You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Size is defined as returning -1 if the type is not fixed-size.
Before this CL cases like Size((*[]int)(nil)) would crash.
Fixesgolang#60892
Change-Id: Iee8e20a0aee24b542b78cb4160c3b2c5a3eb02c2
Reviewed-on: https://go-review.googlesource.com/c/go/+/504575
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
What version of Go are you using (
go version
)?1.20
Does this issue reproduce with the latest release?
Yes.
What did you do?
Pass
(*[]byte)(nil)
tobinary.Size
.https://go.dev/play/p/eKvs4FJHkxy
What did you expect to see?
The function should return
-1
.What did you see instead?
The function panicked instead:
The text was updated successfully, but these errors were encountered: