]> Cypherpunks repositories - gostls13.git/commit
spec: clarify that slice a expression shares underlying array with operand
authorRobert Griesemer <gri@golang.org>
Tue, 14 May 2019 17:22:04 +0000 (10:22 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 14 May 2019 22:30:48 +0000 (22:30 +0000)
commit1e3ffb0c902fc282469e7748ce066ee9ea7a6580
treec55a0f3783d93fc8694967815857933a2f0f337f
parent02d24fc2528578065b506f07bc6214adcac3be4b
spec: clarify that slice a expression shares underlying array with operand

The spec was not very precise as to what happens with respect to sharing
if a sliced operand is (a pointer to) an array. Added a small clarification
and a supporting example.

Fixes #31689.

Change-Id: Ic49351bec2033abd3f5428154ec3e9a7c2c9eaa5
Reviewed-on: https://go-review.googlesource.com/c/go/+/177139
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
doc/go_spec.html