1
0
mirror of https://github.com/golang/go synced 2024-11-16 19:54:55 -07:00
go/doc
Robert Griesemer 2b9b2720b8 spec: split shift examples into groups for 32- and 64-bit ints
In the current (pre-CL) version of the spec, the 2nd last shift
example appears to be using the array declared in the last example.
On a 32-bit platform, that array would have length 0, which would
lead to a panic in the 2nd last example. Also, if this code were
inside a function, it wouldn't compile (array declared after use).

Use an explicitly declared array for that specific shift example.
Also, split out all cases that produce different results for 32-
vs 64-bit ints.

Fixes #41835.

Change-Id: Ie45114224509e4999197226f91f7f6f934449abb
Reviewed-on: https://go-review.googlesource.com/c/go/+/260398
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-10-30 16:20:05 +00:00
..
articles doc/articles/wiki: add missing log import to net/http tutorial 2020-08-16 21:51:36 +00:00
codewalk
gopher doc/gopher: add model sheet 2018-07-18 04:00:10 +00:00
play
progs all: replace Replace(..., -1) with ReplaceAll(...) 2020-08-17 04:07:23 +00:00
asm.html doc/asm: add BP is callee-save paragraph 2020-09-01 14:54:08 +00:00
cmd.html
contribute.html doc: mention Trust+1 in contribution guide 2020-10-28 19:28:08 +00:00
debugging_with_gdb.html
diagnostics.html runtime: implement GODEBUG=inittrace=1 support 2020-10-14 05:34:32 +00:00
editors.html doc/editors.html: update VS Code Go extension url 2020-07-08 13:59:06 +00:00
effective_go.html doc: add note about missing lock in sample code 2020-06-30 13:02:41 +00:00
gccgo_contribute.html
gccgo_install.html doc/gccgo: change gold build instructions to use Git repository 2020-06-15 19:05:29 +00:00
go1.1.html
go1.2.html
go1.3.html
go1.4.html
go1.5.html
go1.6.html
go1.7.html
go1.8.html
go1.9.html
go1.10.html all: avoid awkward wording from CL 236857 2020-06-08 21:36:04 +00:00
go1.11.html
go1.12.html
go1.13.html
go1.14.html doc/go1.14: document json.Umarshal map key support of TextUnmarshaler 2020-08-27 09:47:26 +00:00
go1.15.html doc/go1.15: include behavior updates to the context package 2020-08-12 23:25:46 +00:00
go1.16.html Revert "cmd/compile: split exported/non-exported methods for interface type" 2020-10-28 17:10:08 +00:00
go1.html
go1compat.html
go_faq.html doc/faq: fix a grammar mistake 2020-06-25 02:59:06 +00:00
go_mem.html
go_spec.html spec: split shift examples into groups for 32- and 64-bit ints 2020-10-30 16:20:05 +00:00
go-logo-black.png
go-logo-blue.png
go-logo-white.png
help.html doc: add alt attribute to gopher image in help.html 2020-06-29 17:59:28 +00:00
ie.css
install-source.html doc: update install docs for 387->softfloat transition 2020-10-09 02:49:19 +00:00
install.html
share.png
tos.html