mirror of
https://github.com/golang/go
synced 2024-09-05 16:04:50 +00:00
spec: clarify behavior of map size hint for make built-in
The spec already states that the precise behavior of the map size hint provided to the make built-in is implementation-dependent. Exclude requiring specific run-time behavior for maps. (The current Go compiler does not panic if the size hint is negative at run-time.) Fixes #53219. Change-Id: I2f3618bf9ba4ed921e18dc4f2273eaa770805bd7 Reviewed-on: https://go-review.googlesource.com/c/go/+/411919 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
4703546a29
commit
5ee939b819
|
@ -7141,7 +7141,7 @@ A constant size argument must be non-negative and <a href="#Representability">re
|
|||
by a value of type <code>int</code>; if it is an untyped constant it is given type <code>int</code>.
|
||||
If both <code>n</code> and <code>m</code> are provided and are constant, then
|
||||
<code>n</code> must be no larger than <code>m</code>.
|
||||
If <code>n</code> is negative or larger than <code>m</code> at run time,
|
||||
For slices and channels, if <code>n</code> is negative or larger than <code>m</code> at run time,
|
||||
a <a href="#Run_time_panics">run-time panic</a> occurs.
|
||||
</p>
|
||||
|
||||
|
|
Loading…
Reference in a new issue