diff --git a/doc/go_spec.html b/doc/go_spec.html index dc08db991da..45dd1e29395 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -4920,15 +4920,18 @@ make(T, n) channel asynchronous channel of type T, buffer size n
-The arguments n
and m
must be of integer type.
-A run-time panic occurs if n
-is negative or larger than m
, or if n
or
-m
cannot be represented by an int
.
+The size arguments n
and m
must be integer values.
+A constant size argument must not be negative, and
+if both n
and m
are provided and are constant, then
+n
must be no larger than m
.
+If n
is negative or larger than m
at run time,
+a run-time panic occurs.
s := make([]int, 10, 100) // slice with len(s) == 10, cap(s) == 100 -s := make([]int, 10) // slice with len(s) == cap(s) == 10 +s := make([]int, 1e3) // slice with len(s) == cap(s) == 1000 +s := make([]int, 10, 0) // illegal: len(s) > cap(s) c := make(chan int, 10) // channel with a buffer size of 10 m := make(map[string]int, 100) // map with initial space for 100 elements