diff options
author | Ian Lance Taylor <iant@golang.org> | 2021-07-01 16:52:59 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2021-07-02 19:26:52 +0000 |
commit | 743f03eeb0bdcb596b46fae51d23c0fcf0db0474 (patch) | |
tree | 74c9892c8adbca11153bebf30f077e2c2eb46b4b /doc | |
parent | 6125d0c4265067cdb67af1340bf689975dd128f4 (diff) | |
download | go-743f03eeb0bdcb596b46fae51d23c0fcf0db0474.tar.gz go-743f03eeb0bdcb596b46fae51d23c0fcf0db0474.zip |
spec, unsafe: clarify unsafe.Slice docs
For #19367
Change-Id: If0ff8ddba3b6b48e2e198cf3653e73284c7572a3
Reviewed-on: https://go-review.googlesource.com/c/go/+/332409
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/go_spec.html | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/doc/go_spec.html b/doc/go_spec.html index e0602418e8..ad21ffb1b8 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ <!--{ "Title": "The Go Programming Language Specification", - "Subtitle": "Version of Jun 28, 2021", + "Subtitle": "Version of Jul 1, 2021", "Path": "/ref/spec" }--> @@ -6782,7 +6782,8 @@ The rules for <a href="/pkg/unsafe#Pointer">valid uses</a> of <code>Pointer</cod <p> The function <code>Slice</code> returns a slice whose underlying array starts at <code>ptr</code> -and whose length and capacity are <code>len</code>: +and whose length and capacity are <code>len</code>. +<code>Slice(ptr, len)</code> is equivalent to </p> <pre> @@ -6790,7 +6791,8 @@ and whose length and capacity are <code>len</code>: </pre> <p> -As a special case, if <code>ptr</code> is <code>nil</code> and <code>len</code> is zero, +except that, as a special case, if <code>ptr</code> +is <code>nil</code> and <code>len</code> is zero, <code>Slice</code> returns <code>nil</code>. </p> |