Compare commits

..

89 Commits

Author SHA1 Message Date
Russ Cox
8a5ef1501d [dev.typealias] all: merge go1.8.3 into dev.typealias
352996a381 (tag: go1.8.3) [release-branch.go1.8] go1.8.3
bb5055d6f1 [release-branch.go1.8] doc: document go1.8.3
439c0c8be8 [release-branch.go1.8] cmd/compile: don't move spills to loop exits where the spill is dead
e396667ba3 [release-branch.go1.8] cmd/compile: zero ambiguously live variables at VARKILLs
daf6706f37 [release-branch.go1.8] runtime: use pselect6 for usleep on linux/386
958c64bbab [release-branch.go1.8] runtime: use pselect6 for usleep on linux/amd64 and linux/arm
195e20a976 [release-branch.go1.8] cmd/compile: ignore types when considering tuple select for CSE
f55bc1c4eb [release-branch.go1.8] net/http: update bundled http2 for gracefulShutdownCh lock contention slowdown
51f508bb4a [release-branch.go1.8] cmd/compile: fix s390x unsigned comparison constant merging rules
243dee1737 [release-branch.go1.8] cmd/go: if we get a C compiler dwarf2 warning, try without -g
a43c0d2dc8 [release-branch.go1.8] runtime: don't corrupt arena bounds on low mmap
1054085dcf [release-branch.go1.8] cmd/compile: fix store chain in schedule pass
18a13d373a [release-branch.go1.8] runtime: doubly fix "double wakeup" panic
6efa2f22ac [release-branch.go1.8] database/sql: ensure releaseConn is defined before a possible close
fb9770f09b [release-branch.go1.8] runtime: print debug info on "base out of range"
b6a8fc8d8c [release-branch.go1.8] doc: remove mentions of yacc tool
59870f9e19 (tag: go1.8.2) [release-branch.go1.8] go1.8.2
c9688ddb6b [release-branch.go1.8] doc: document go1.8.2 and go1.7.6
38d35f49e7 [release-branch.go1.8] crypto/elliptic: fix carry bug in x86-64 P-256 implementation.

Change-Id: I2aa0eab7a990d24e25809fb13ce6cb031104f474
2017-06-14 13:53:57 -04:00
Chris Broadfoot
352996a381 [release-branch.go1.8] go1.8.3
Change-Id: I048f21f8ca68758fdd7ac875f7db5e4ed1930f3b
Reviewed-on: https://go-review.googlesource.com/44037
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-05-24 18:14:11 +00:00
Chris Broadfoot
bb5055d6f1 [release-branch.go1.8] doc: document go1.8.3
Change-Id: I5d55c3b1011dd10552d8e740fb65886306d91b5c
Reviewed-on: https://go-review.googlesource.com/44035
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/44036
2017-05-24 18:12:51 +00:00
Keith Randall
439c0c8be8 [release-branch.go1.8] cmd/compile: don't move spills to loop exits where the spill is dead
We shouldn't move a spill to a loop exit where the spill itself
is dead.  The stack location assigned to the spill might already
be reused by another spill at this point.

The case we previously handled incorrectly is the one where the value
being spilled is still live, but the spill itself is dead.

Fixes #20472

Patching directly on the release branch because the spill moving code has
already been rewritten for 1.9. (And it doesn't have this bug.)

Change-Id: I26c5273dafd98d66ec448750073c2b354ef89ad6
Reviewed-on: https://go-review.googlesource.com/44033
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-05-24 15:44:39 +00:00
Keith Randall
e396667ba3 [release-branch.go1.8] cmd/compile: zero ambiguously live variables at VARKILLs
This is a redo of CL 41076 backported to the 1.8 release branch.
There were major conflicts, so I had to basically rewrite it again
from scratch.  The way Progs are allocated changed.  Liveness analysis
and Prog generation got reordered.  Liveness analysis changed from
running on gc.BasicBlock to ssa.Block.  All that makes the logic quite
a bit different.

Please review carefully.

From CL 41076:

At VARKILLs, zero a variable if it is ambiguously live.
After the VARKILL anything this variable references
might be collected. If it were to become live again later,
the GC will see references to already-collected objects.

We don't know a variable is ambiguously live until very
late in compilation (after lowering, register allocation, ...),
so it is hard to generate the code in an arch-independent way.
We also have to be careful not to clobber any registers.
Fortunately, this almost never happens so performance is ~irrelevant.

There are only 2 instances where this triggers in the stdlib.

Fixes #20029

Change-Id: Ibb757eec58ee07f40df5e561b19d315684dc4bda
Reviewed-on: https://go-review.googlesource.com/43998
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-05-24 15:23:47 +00:00
Austin Clements
daf6706f37 [release-branch.go1.8] runtime: use pselect6 for usleep on linux/386
Commit 4dcba023c6 replaced select with pselect6 on linux/amd64 and
linux/arm, but it turns out the Android emulator uses linux/386. This
makes the equivalent change there, too.

Fixes #20409 more.

Change-Id: If542d6ade06309aab8758d5f5f6edec201ca7670
Reviewed-on: https://go-review.googlesource.com/44011
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
(cherry picked from commit ecad34a40ea390ddf5ba2da8f3c3f2c5f15297c8)
Reviewed-on: https://go-review.googlesource.com/44002
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-05-23 23:21:19 +00:00
Austin Clements
958c64bbab [release-branch.go1.8] runtime: use pselect6 for usleep on linux/amd64 and linux/arm
Android O black-lists the select system call because its libc, Bionic,
does not use this system call. Replace our use of select with pselect6
(which is allowed) on the platforms that support targeting Android.
linux/arm64 already uses pselect6 because there is no select on arm64,
so only linux/amd64 and linux/arm need changing. pselect6 has been
available since Linux 2.6.16, which is before Go's minimum
requirement.

Fixes #20409.

Change-Id: Ic526b5b259a9e01d2f145a1f4d2e76e8c49ce809
Reviewed-on: https://go-review.googlesource.com/43641
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
(cherry picked from commit 4dcba023c6)
Reviewed-on: https://go-review.googlesource.com/44001
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-05-23 23:21:13 +00:00
Todd Neal
195e20a976 [release-branch.go1.8] cmd/compile: ignore types when considering tuple select for CSE
Fixes #20097

Change-Id: I3c9626ccc8cd0c46a7081ea8650b2ff07a5d4fcd
Reviewed-on: https://go-review.googlesource.com/41505
Run-TryBot: Todd Neal <todd@tneal.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-on: https://go-review.googlesource.com/43997
Run-TryBot: Chris Broadfoot <cbro@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-05-23 21:25:37 +00:00
Brad Fitzpatrick
f55bc1c4eb [release-branch.go1.8] net/http: update bundled http2 for gracefulShutdownCh lock contention slowdown
This updates the bundled x/net/http2 repo to git rev 186fd3fc (from
the net repo's release-branch.go1.8) for:

    [release-branch.go1.8] http2: fix lock contention slowdown due to gracefulShutdownCh
    https://golang.org/cl/43459

Fixes #20302

Change-Id: Ia01a44c6749292de9c16ca330bdebe1e52458b18
Reviewed-on: https://go-review.googlesource.com/43996
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-05-23 20:37:03 +00:00
Michael Munday
51f508bb4a [release-branch.go1.8] cmd/compile: fix s390x unsigned comparison constant merging rules
On s390x unsigned integer comparisons with immediates require the immediate
to be an unsigned 32-bit integer. The rule was checking that the immediate
was a signed 32-bit integer.

This CL also adds a test for comparisons that could be turned into compare
with immediate or equivalent instructions (depending on architecture and
optimizations applied).

Cherry-pick of CL 40433 and CL 40873.

Fixes #19940.

Reviewed-on: https://go-review.googlesource.com/40931
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

Change-Id: I3daaeaa40d7637bd4421e6b8d37ea4ffd74448ce
Reviewed-on: https://go-review.googlesource.com/43994
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-05-23 20:03:07 +00:00
Brad Fitzpatrick
243dee1737 [release-branch.go1.8] cmd/go: if we get a C compiler dwarf2 warning, try without -g
Backport of CL 38072

Fixes #14705

Reviewed-on: https://go-review.googlesource.com/42500
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>

Change-Id: Ia6ce2a41434aef2f8745a6a862ea66608b1e25f7
Reviewed-on: https://go-review.googlesource.com/43995
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-05-23 20:03:04 +00:00
Austin Clements
a43c0d2dc8 [release-branch.go1.8] runtime: don't corrupt arena bounds on low mmap
Cherry-pick of CL 43870.

If mheap.sysAlloc doesn't have room in the heap arena for an
allocation, it will attempt to map more address space with sysReserve.
sysReserve is given a hint, but can return any unused address range.
Currently, mheap.sysAlloc incorrectly assumes the returned region will
never fall between arena_start and arena_used. If it does,
mheap.sysAlloc will blindly accept the new region as the new
arena_used and arena_end, causing these to decrease and make it so any
Go heap above the new arena_used is no longer considered part of the
Go heap. This assumption *used to be* safe because we had all memory
between arena_start and arena_used mapped, but when we switched to an
arena_start of 0 on 32-bit, it became no longer safe.

Most likely, we've only recently seen this bug occur because we
usually start arena_used just above the binary, which is low in the
address space. Hence, the kernel is very unlikely to give us a region
before arena_used.

Since mheap.sysAlloc is a linear allocator, there's not much we can do
to handle this well. Hence, we fix this problem by simply rejecting
the new region if it isn't after arena_end. In this case, we'll take
the fall-back path and mmap a small region at any address just for the
requested memory.

Fixes #20259.

Change-Id: Ib72e8cd621545002d595c7cade1e817cfe3e5b1e
Reviewed-on: https://go-review.googlesource.com/43954
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-05-23 19:42:57 +00:00
Keith Randall
1054085dcf [release-branch.go1.8] cmd/compile: fix store chain in schedule pass
Cherry-pick of CL 43294.

Tuple ops are weird. They are essentially a pair of ops,
one which consumes a mem and one which generates a mem (the Select1).
The schedule pass didn't handle these quite right.

Fix the scheduler to include both parts of the paired op in
the store chain. That makes sure that loads are correctly ordered
with respect to the first of the pair.

Add a check for the ssacheck builder, that there is only one
live store at a time. I thought we already had such a check, but
apparently not...

Fixes #20335

Change-Id: I59eb3446a329100af38d22820b1ca2190ca46a78
Reviewed-on: https://go-review.googlesource.com/43411
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-05-23 19:42:16 +00:00
Austin Clements
18a13d373a [release-branch.go1.8] runtime: doubly fix "double wakeup" panic
Cherry-pick of CL 43311.

runtime.gchelper depends on the non-atomic load of work.ndone
happening strictly before the atomic add of work.nwait. Until very
recently (commit 978af9c2db, fixing #20334), the compiler reordered
these operations. This created a race since work.ndone can change as
soon as work.nwait is equal to work.ndone. If that happened, more than
one gchelper could attempt to wake up the work.alldone note, causing a
"double wakeup" panic.

This was fixed in the compiler, but to make this code less subtle,
make the load of work.ndone atomic. This clearly forces the order of
these operations, ensuring the race doesn't happen.

Fixes #19305 (though really 978af9c2db fixed it).

Change-Id: Ieb1a84e1e5044c33ac612c8a5ab6297e7db4c57d
Reviewed-on: https://go-review.googlesource.com/43412
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-05-23 19:42:13 +00:00
Daniel Theophanes
6efa2f22ac [release-branch.go1.8] database/sql: ensure releaseConn is defined before a possible close
Applies https://golang.org/cl/42139 to the go1.8 release branch.

Also correct two minor issues detected with go vet.

Fixes #20217

Change-Id: I2c41af9497493598fbcfc140439b4e25b9bb7e72
Reviewed-on: https://go-review.googlesource.com/42532
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-05-23 19:41:50 +00:00
Austin Clements
fb9770f09b [release-branch.go1.8] runtime: print debug info on "base out of range"
Cherry-pick of CL 43310.

This adds debugging information when we panic with "heapBitsForSpan:
base out of range".

Updates #20259.

Change-Id: I0dc1a106aa9e9531051c7d08867ace5ef230eb3f
Reviewed-on: https://go-review.googlesource.com/43410
Run-TryBot: Austin Clements <austin@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-05-23 19:41:17 +00:00
Brad Fitzpatrick
b6a8fc8d8c [release-branch.go1.8] doc: remove mentions of yacc tool
It was removed in CL 27325.

Fixes #20431

Change-Id: I6842851444186e19029d040f61fdf4f87a3103a6
Reviewed-on: https://go-review.googlesource.com/43771
Reviewed-by: Ian Lance Taylor <iant@golang.org>
(cherry picked from commit deebd8fe273df2de2d590ee41ae1155c521219e9)
Reviewed-on: https://go-review.googlesource.com/43772
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-05-23 19:41:10 +00:00
Chris Broadfoot
59870f9e19 [release-branch.go1.8] go1.8.2
Change-Id: Ib04878cbfbb0c09fbd0cc614df314c835e9a6eb0
Reviewed-on: https://go-review.googlesource.com/43991
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-05-23 18:32:59 +00:00
Chris Broadfoot
c9688ddb6b [release-branch.go1.8] doc: document go1.8.2 and go1.7.6
Change-Id: I2ed2e8c4890a65288cf3066ebe3c1d9a16fb4c05
Reviewed-on: https://go-review.googlesource.com/43990
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/43993
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-05-23 17:52:49 +00:00
Adam Langley
38d35f49e7 [release-branch.go1.8] crypto/elliptic: fix carry bug in x86-64 P-256 implementation.
Patch from Vlad Krasnov and confirmed to be under CLA.

Fixes #20040.

Change-Id: Ieb8436c4dcb6669a1620f1e0d257efd047b1b87c
Reviewed-on: https://go-review.googlesource.com/41070
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 9294fa2749)
Reviewed-on: https://go-review.googlesource.com/43770
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-05-23 17:31:44 +00:00
Russ Cox
1ba29926f3 [dev.typealias] dev.typealias: merge go1.8.1 into dev.typealias
This also includes fixes since Go 1.8rc3.

a4c18f063b [release-branch.go1.8] go1.8.1
8babce23e3 [release-branch.go1.8] doc: document go1.8.1
853d533ed6 [release-branch.go1.8] cmd/go: add test for test -race -i behavior
166f2159d8 [release-branch.go1.8] cmd/go: do not install broken libraries during 'go test -i -race'
95a5b80e6d [release-branch.go1.8] cmd/compile: added special case for reflect header fields to esc
fe79c75268 [release-branch.go1.8] cmd/compile: add missing WBs for reflect.{Slice,String}Header.Data
d7989b784e [release-branch.go1.8] cmd/link: skip TestDWARF when cgo is disabled
056be9f79c [release-branch.go1.8] cmd/link: skip TestDWARF on Plan 9
02240408a1 [release-branch.go1.8] encoding/xml: disable checking of attribute syntax, like Go 1.7
04017ffadf [release-branch.go1.8] reflect: fix out-of-bounds pointers calling no-result method
2d0043014f [release-branch.go1.8] cmd/link: emit a mach-o dwarf segment that dsymutil will accept
3ca0d34fa1 [release-branch.go1.8] cmd/link: make mach-o dwarf segment properly aligned
84192f2734 [release-branch.go1.8] cmd/link: disable mach-o dwarf munging with -w (in addition to -s)
752b8b773d [release-branch.go1.8] cmd/compile: don't crash when slicing non-slice
ff5695d0fd [release-branch.go1.8] runtime: print user stack on other threads during GOTRACBEACK=crash
517a38c630 [release-branch.go1.8] test/fixedbugs: add test for #19403
dc70a5efd1 [release-branch.go1.8] cmd/compile: mark MOVWF/MOVFW clobbering F15 on ARM
77476e81d9 [release-branch.go1.8] cmd/compile,runtime: fix atomic And8 for mipsle
bf71119d54 [release-branch.go1.8] cmd/compile: repaired loop-finder to handle trickier nesting
11a224bc56 [release-branch.go1.8] cmd/compile: add opcode flag hasSideEffects for do-not-remove
3a8841bcaf [release-branch.go1.8] cmd/link: do not pass -s through to host linker on macOS
6c5abcf21a [release-branch.go1.8] text/template: fix handling of empty blocks
43fa04c23c [release-branch.go1.8] image/png: restore Go 1.7 rejection of transparent gray8 images
e35c01b404 [release-branch.go1.8] net, net/http: adjust time-in-past constant even earlier
c955eb1935 [release-branch.go1.8] cmd/compile/internal/ssa: don't schedule values after select
f8ed4539eb [release-branch.go1.8] os/exec: deflake TestStdinCloseRace
d43130743c [release-branch.go1.8] cmd/link: put plt stubs first in Textp on ppc64x
0a5cec792f [release-branch.go1.8] doc: reorganize the contribution guidelines into a guide
8890527476 [release-branch.go1.8] time: make the ParseInLocation test more robust
ea6781bcd0 [release-branch.go1.8] crypto/tls: make Config.Clone also clone the GetClientCertificate field
2327d696c1 [release-branch.go1.8] cmd/compile: do not fold offset into load/store for args on ARM64
ba48d2002e [release-branch.go1.8] cmd/compile: check both syms when folding address into load/store on ARM64
b43fabfb30 [release-branch.go1.8] cmd/compile: add zero-extension before right shift when lowering Lrot on ARM
6a712dfac1 [release-branch.go1.8] cmd/compile: fix merging of s390x conditional moves into branch conditions
865536b197 [release-branch.go1.8] cmd/compile: remove unnecessary type conversions on s390x
bae53daa72 [release-branch.go1.8] runtime: avoid O(n) semaphore list walk in contention profiling
d4ee1f4a40 [release-branch.go1.8] website: mention go1.8 in project page
991ee8f4ac [release-branch.go1.8] doc: fix broken link in go1.8.html
cd6b6202dd [release-branch.go1.8] go1.8
606eb9b0c1 [release-branch.go1.8] doc: document go1.8
bcda91c18d [release-branch.go1.8] runtime: do not call wakep from enlistWorker, to avoid possible deadlock
7d7a0a9d64 [release-branch.go1.8] doc: update Code of Conduct wording and scope
cedc511a6e [release-branch.go1.8] encoding/xml: fix incorrect indirect code in chardata, comment, innerxml fields
ae13ccfd6d [release-branch.go1.8] database/sql: convert test timeouts to explicit waits with checks
7cec9a583d [release-branch.go1.8] reflect: clear ptrToThis in Ptr when allocating result on heap
d84dee069a [release-branch.go1.8] database/sql: ensure driverConns are closed if not returned to pool
f1e44a4b74 [release-branch.go1.8] database/sql: do not exhaust connection pool on conn request timeout
3ade54063e [release-branch.go1.8] database/sql: record the context error in Rows if canceled
0545006bdb [release-branch.go1.8] crypto/x509: check for new tls-ca-bundle.pem last
1363eeba65 [release-branch.go1.8] cmd/go, go/build: better defenses against GOPATH=GOROOT
1edfd64761 [release-branch.go1.8] cmd/compile: do not use "oaslit" for global
6eb0f5440e [release-branch.go1.8] cmd/compile/internal/syntax: avoid follow-up error for incorrect if statement
c543cc353d [release-branch.go1.8] cmd/compile/internal/syntax: make a parser error "1.7 compliant"
f0749fe163 [release-branch.go1.8] cmd/link: use external linking for PIE by default
ba878ac0c8 [release-branch.go1.8] doc: remove inactive members of the CoC working group
6177f6d448 [release-branch.go1.8] vendor/golang.org/x/crypto/curve25519: avoid loss of R15 in -dynlink mode
67cd1fa780 [release-branch.go1.8] cmd/compile: do not fold large offset on ARM64

Change-Id: I907afba886429c4feb36c9895f16046eeab4ad5f
2017-04-10 08:48:35 -04:00
Chris Broadfoot
a4c18f063b [release-branch.go1.8] go1.8.1
Change-Id: Ieb4552841bbf488acdbde805958a1e2ae0bd8aa3
Reviewed-on: https://go-review.googlesource.com/39920
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-07 16:48:41 +00:00
Chris Broadfoot
8babce23e3 [release-branch.go1.8] doc: document go1.8.1
Change-Id: I9282c1907204ec5c6363de84faec222a38300c9f
Reviewed-on: https://go-review.googlesource.com/39919
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/39921
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-04-07 16:48:09 +00:00
Russ Cox
853d533ed6 [release-branch.go1.8] cmd/go: add test for test -race -i behavior
This was fixed in CL 37598 but the test was (rightly) dropped
because it modified $GOROOT. Here's a variant that does not.

For #19151.

Change-Id: Iccdbbf9ae8ac4c252e52f4f8ff996963573c4682
Reviewed-on: https://go-review.googlesource.com/39592
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/39618
Reviewed-by: Austin Clements <austin@google.com>
2017-04-05 20:34:07 +00:00
Russ Cox
166f2159d8 [release-branch.go1.8] cmd/go: do not install broken libraries during 'go test -i -race'
Manual port of CL 37598 (submitted for Go 1.9) to Go 1.8.1.

Fixes #19133.
Fixes #19151.

Change-Id: I51707ea35068a393022f554b391ee2638dba16b5
Reviewed-on: https://go-review.googlesource.com/39617
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2017-04-05 20:34:00 +00:00
David Chase
95a5b80e6d [release-branch.go1.8] cmd/compile: added special case for reflect header fields to esc
The uintptr-typed Data field in reflect.SliceHeader and
reflect.StringHeader needs special treatment because it is
really a pointer.  Add the special treatment in walk for
bug #19168 to escape analysis.

Includes extra debugging that was helpful.

Fixes #19743.

Change-Id: I6dab5002f0d436c3b2a7cdc0156e4fc48a43d6fe
Reviewed-on: https://go-review.googlesource.com/39616
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2017-04-05 19:28:05 +00:00
Matthew Dempsky
fe79c75268 [release-branch.go1.8] cmd/compile: add missing WBs for reflect.{Slice,String}Header.Data
Fixes #19168.

(*state).insertWBstore needed to be tweaked for backporting so that
store reflect.{Slice,String}Header.Data stores still fallthrough and
end the SSA block. This wasn't necessary at master because of CL
36834.

Change-Id: I3f4fcc0b189c53819ac29ef8de86fdad76a17488
Reviewed-on: https://go-review.googlesource.com/39615
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Austin Clements <austin@google.com>
2017-04-05 19:28:00 +00:00
Josh Bleecher Snyder
d7989b784e [release-branch.go1.8] cmd/link: skip TestDWARF when cgo is disabled
While we're here, fix a Skip/Skipf error I noticed.

Fixes #19796.

(This fixes failures on the release branch introduced by cherry-pick
CL 39605.)

Change-Id: I59b1f5b5ea727fc314acfee8445b3de0b5af1e46
Reviewed-on: https://go-review.googlesource.com/39612
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-05 18:11:34 +00:00
David du Colombier
056be9f79c [release-branch.go1.8] cmd/link: skip TestDWARF on Plan 9
TestDWARF has been added in CL 38855. This test is
failing on Plan 9 because executables don't have
a DWARF symbol table.

Fixes #19793.

(This fixes Plan 9 failures on the release branch introduced by
cherry-pick CL 39605.)

Change-Id: I7fc547a7c877b58cc4ff6b4eb5b14852e8b4668b
Reviewed-on: https://go-review.googlesource.com/39611
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-05 18:11:31 +00:00
Russ Cox
02240408a1 [release-branch.go1.8] encoding/xml: disable checking of attribute syntax, like Go 1.7
Consider this struct, which expects an attribute A and a child C both ints:

    type X struct {
        XMLName xml.Name `xml:"X"`
        A       int      `xml:",attr"`
        C       int
    }

Go 1.2 through Go 1.7 were consistent: attributes unchecked,
children strictly checked:

    $ go1.7 run /tmp/x.go
    <X></X>              ok
    <X A=""></X>         ok
    <X A="bad"></X>      ok
    <X></X>              ok
    <X><C></C></X>       ERROR strconv.ParseInt: parsing "": invalid syntax
    <X><C/></X>          ERROR strconv.ParseInt: parsing "": invalid syntax
    <X><C>bad</C></X>    ERROR strconv.ParseInt: parsing "bad": invalid syntax
    $

Go 1.8 made attributes strictly checked, matching children:

    $ go1.8 run /tmp/x.go
    <X></X>              ok
    <X A=""></X>         ERROR strconv.ParseInt: parsing "": invalid syntax
    <X A="bad"></X>      ERROR strconv.ParseInt: parsing "bad": invalid syntax
    <X></X>              ok
    <X><C></C></X>       ERROR strconv.ParseInt: parsing "": invalid syntax
    <X><C/></X>          ERROR strconv.ParseInt: parsing "": invalid syntax
    <X><C>bad</C></X>    ERROR strconv.ParseInt: parsing "bad": invalid syntax
    $

but this broke XML code that had empty attributes (#19333).

In Go 1.9 we plan to start allowing empty children (#13417).
The fix for that will also make empty attributes work again:

    $ go run /tmp/x.go  # Go 1.9 development
    <X></X>              ok
    <X A=""></X>         ok
    <X A="bad"></X>      ERROR strconv.ParseInt: parsing "bad": invalid syntax
    <X></X>              ok
    <X><C></C></X>       ok
    <X><C/></X>          ok
    <X><C>bad</C></X>    ERROR strconv.ParseInt: parsing "bad": invalid syntax
    $

For Go 1.8.1, we want to restore the empty attribute behavior
to match Go 1.7 but not yet change the child behavior as planned for Go 1.9,
since that change hasn't been through release testing.

Instead, restore the more lax Go 1.7 behavior, so that XML files
with empty attributes will not be broken until Go 1.9:

    $ go run /tmp/x.go  # after this CL
    <X></X>              ok
    <X A=""></X>         ok
    <X A="bad"></X>      ok
    <X></X>              ok
    <X><C></C></X>       ERROR strconv.ParseInt: parsing "": invalid syntax
    <X><C/></X>          ERROR strconv.ParseInt: parsing "": invalid syntax
    <X><C>bad</C></X>    ERROR strconv.ParseInt: parsing "bad": invalid syntax
    $

Fixes #19333.

Change-Id: I3d38ebd2509f5b6ea3fd4856327f887f9a1a8085
Reviewed-on: https://go-review.googlesource.com/39607
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Sarah Adams <shadams@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-05 17:00:21 +00:00
Austin Clements
04017ffadf [release-branch.go1.8] reflect: fix out-of-bounds pointers calling no-result method
reflect.callReflect heap-allocates a stack frame and then constructs
pointers to the arguments and result areas of that frame. However, if
there are no results, the results pointer will point past the end of
the frame allocation. If there are also no arguments, the arguments
pointer will also point past the end of the frame allocation. If the
GC observes either these pointers, it may panic.

Fix this by not constructing these pointers if these areas of the
frame are empty.

This adds a test of calling no-argument/no-result methods via reflect,
since nothing in std did this before. However, it's quite difficult to
demonstrate the actual failure because it depends on both exact
allocation patterns and on GC scanning the goroutine's stack while
inside one of the typedmemmovepartial calls.

I also audited other uses of typedmemmovepartial and
memclrNoHeapPointers in reflect, since these are the most susceptible
to this. These appear to be the only two cases that can construct
out-of-bounds arguments to these functions.

Fixes #19724.
Fixes #19768 (backport).

Change-Id: I4b83c596b5625dc4ad0567b1e281bad4faef972b
Reviewed-on: https://go-review.googlesource.com/39604
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
2017-04-05 16:58:37 +00:00
Russ Cox
2d0043014f [release-branch.go1.8] cmd/link: emit a mach-o dwarf segment that dsymutil will accept
Right now, at least with Xcode 8.3, we invoke dsymutil and dutifully
copy what it produces back into the binary, but it has actually dropped
all the DWARF information that we wanted, because it didn't like
the look of go.o.

Make it like the look of go.o.

DWARF is tested in other ways, but typically indirectly and not for cgo programs.
Add a direct test, and one that exercises cgo.
This detects missing dwarf information in cgo-using binaries on macOS,
at least with Xcode 8.3, and possibly earlier versions as well.

Fixes #19772.

The backport to Go 1.8 disables TestDWARF on Windows because Windows
DWARF support is new in Go 1.9.

Change-Id: I0082e52c0bc8fc4e289770ec3dc02f39fd61e743
Reviewed-on: https://go-review.googlesource.com/39605
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2017-04-05 16:58:35 +00:00
Russ Cox
3ca0d34fa1 [release-branch.go1.8] cmd/link: make mach-o dwarf segment properly aligned
Without this, the load fails during kernel exec, which results in the
mysterious and completely uninformative "Killed: 9" error.

It appears that the stars (or at least the inputs) were properly aligned
with earlier versions of Xcode so that this happened accidentally.
Make it happen on purpose.

Gregory Man bisected the breakage to this change in LLVM,
which fits the theory nicely:
https://github.com/llvm-mirror/llvm/commit/9a41e59c

Fixes #19734.

Change-Id: Ice67a09af2de29d3c0d5e3fcde6a769580897c95
Reviewed-on: https://go-review.googlesource.com/39603
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-05 16:58:33 +00:00
Russ Cox
84192f2734 [release-branch.go1.8] cmd/link: disable mach-o dwarf munging with -w (in addition to -s)
Might as well provide a way around the mach-o munging
that doesn't require stripping all symbols.
After all, -w does mean no DWARF.

For #11887, #19734, and anyone else that needs to disable
this code path without losing the symbol table.

Change-Id: I254b7539f97fb9211fa90f446264b383e7f3980f
Reviewed-on: https://go-review.googlesource.com/39602
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-05 16:58:31 +00:00
Josh Bleecher Snyder
752b8b773d [release-branch.go1.8] cmd/compile: don't crash when slicing non-slice
Fixes #19323
Fixes #19638 (backport)

Change-Id: I92d1bdefb15de6178a577a4fa0f0dc004f791904
Reviewed-on: https://go-review.googlesource.com/39601
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-05 16:58:29 +00:00
Austin Clements
ff5695d0fd [release-branch.go1.8] runtime: print user stack on other threads during GOTRACBEACK=crash
Currently, when printing tracebacks of other threads during
GOTRACEBACK=crash, if the thread is on the system stack we print only
the header for the user goroutine and fail to print its stack. This
happens because we passed the g0 to traceback instead of curg. The g0
never has anything set in its gobuf, so traceback doesn't print
anything.

Fix this by passing _g_.m.curg to traceback instead of the g0.

Fixes #19494.
Fixes #19637 (backport).

Change-Id: Idfabf94d6a725e9cdf94a3923dead6455ef3b217
Reviewed-on: https://go-review.googlesource.com/39600
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-05 16:58:26 +00:00
Quentin Smith
517a38c630 [release-branch.go1.8] test/fixedbugs: add test for #19403
Change-Id: Ie52dac8eb4daed95e049ad74d5ae101e8a5cb854
Reviewed-on: https://go-review.googlesource.com/39599
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-05 16:58:24 +00:00
Cherry Zhang
dc70a5efd1 [release-branch.go1.8] cmd/compile: mark MOVWF/MOVFW clobbering F15 on ARM
The assembler back end uses F15 as a temporary register in these
instructions.

Checked the assembler back end and made sure that this is the
only case clobbering F15.

Fixes #19403.

Change-Id: I02b9e00fdd9229db899f501c8e9b306e02912d83
Reviewed-on: https://go-review.googlesource.com/39598
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-04-05 16:58:22 +00:00
Vladimir Stefanovic
77476e81d9 [release-branch.go1.8] cmd/compile,runtime: fix atomic And8 for mipsle
Removing stray xori that came from big endian copy/paste.
Adding atomicand8 check to runtime.check() that would have revealed
this error.
Might fix #19396.

Change-Id: If8d6f25d3e205496163541eb112548aa66df9c2a
Reviewed-on: https://go-review.googlesource.com/39597
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-04-05 16:58:19 +00:00
David Chase
bf71119d54 [release-branch.go1.8] cmd/compile: repaired loop-finder to handle trickier nesting
The loop-A-encloses-loop-C code did not properly handle the
case where really C was already known to be enclosed by B,
and A was nearest-outer to B, not C.

Fixes #19217.

Change-Id: I755dd768e823cb707abdc5302fed39c11cdb34d4
Reviewed-on: https://go-review.googlesource.com/39596
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-05 16:58:17 +00:00
David Chase
11a224bc56 [release-branch.go1.8] cmd/compile: add opcode flag hasSideEffects for do-not-remove
Added a flag to generic and various architectures' atomic
operations that are judged to have observable side effects
and thus cannot be dead-code-eliminated.

Test requires GOMAXPROCS > 1 without preemption in loop.

Fixes #19182.

Change-Id: Id2230031abd2cca0bbb32fd68fc8a58fb912070f
Reviewed-on: https://go-review.googlesource.com/39595
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2017-04-05 16:58:14 +00:00
Russ Cox
3a8841bcaf [release-branch.go1.8] cmd/link: do not pass -s through to host linker on macOS
This keeps the host linker from printing
ld: warning: option -s is obsolete and being ignored

Fixes #19775.

Change-Id: I18dd4e4b3f59cbf35dad770fd65e6baea5a7347f
Reviewed-on: https://go-review.googlesource.com/38851
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/39606
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-05 16:23:00 +00:00
Rob Pike
6c5abcf21a [release-branch.go1.8] text/template: fix handling of empty blocks
This was a subtle bug introduced in the previous release's fix for
issue 16156.

The definition of empty template was broken, causing the answer
to depend on the order of templates in the map.

Fixes #16156 (for real).
Fixes #19294.
Fixes #19204.

Change-Id: I1cd915c94534cad3116d83bd158cbc28700510b9
Reviewed-on: https://go-review.googlesource.com/38420
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/39594
Reviewed-by: Rob Pike <r@golang.org>
2017-04-05 15:26:12 +00:00
Russ Cox
43fa04c23c [release-branch.go1.8] image/png: restore Go 1.7 rejection of transparent gray8 images
Go 1.7 and earlier rejected these images with chunkOrderError.
Go 1.8 panicked during decoding.
Go 1.9 will handle them successfully.

Make Go 1.8.1 match Go 1.7 and earlier, to remove the panic
without introducing new functionality in a minor release.

Fixes #19553.

Change-Id: I3c73a27aa3932300326273b6b563cdf606f3ab64
Reviewed-on: https://go-review.googlesource.com/39593
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-05 15:26:07 +00:00
Brad Fitzpatrick
e35c01b404 [release-branch.go1.8] net, net/http: adjust time-in-past constant even earlier
The aLongTimeAgo time value in net and net/http is used to cancel
in-flight read and writes. It was set to time.Unix(233431200, 0)
which seemed like far enough in the past.

But Raspberry Pis, lacking a real time clock, had to spoil the fun and
boot in 1970 at the Unix epoch time, breaking assumptions in net and
net/http.

So change aLongTimeAgo to time.Unix(1, 0), which seems like the
earliest safe value. I don't trust subsecond values on all operating
systems, and I don't trust the Unix zero time. The Raspberry Pis do
advance their clock at least. And the reported problem was that Hijack
on a ResponseWriter hung forever, waiting for the connection read
operation to finish. So now, even if kernel + userspace boots in under
a second (unlikely), the Hijack will just have to wait for up to a
second.

Updates #19747
Fixes #19771 (backport to Go 1.8.x)

Change-Id: Id59430de2e7b5b5117d4903a788863e9d344e53a
Reviewed-on: https://go-review.googlesource.com/38785
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
(cherry picked from commit e83fc2e44336423dab94bfe74fad4c4e6a4703b3)
Reviewed-on: https://go-review.googlesource.com/38786
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-29 18:29:32 +00:00
Ilya Tocar
c955eb1935 [release-branch.go1.8] cmd/compile/internal/ssa: don't schedule values after select
Scheduling values after calls to selectrecv,
will cause them to be executed multiple times, due to runtime.selectgo
jumping to the next instruction in the selectrecv basic block.
Prevent this by scheduling calls to selectrecv as late as possible

Fixes #19201

Change-Id: I6415792e2c465dc6d9bd6583ba1e54b107bcf5cc
Reviewed-on: https://go-review.googlesource.com/38587
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-03-27 14:51:45 +00:00
Ian Lance Taylor
f8ed4539eb [release-branch.go1.8] os/exec: deflake TestStdinCloseRace
Stop reporting errors from cmd.Process.Kill; they don't matter for
purposes of this test, and they can occur if the process exits quickly.

Fixes #19211.
Fixes #19213.

Change-Id: I1a0bb9170220ca69199abb8e8811b1dde43e1897
Reviewed-on: https://go-review.googlesource.com/37309
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 35ffca31b1)
Reviewed-on: https://go-review.googlesource.com/38607
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-03-25 03:59:40 +00:00
Lynn Boger
d43130743c [release-branch.go1.8] cmd/link: put plt stubs first in Textp on ppc64x
Previously call stubs were generated and inserted in
Textp after much of the text, resulting in calls too
far in some cases. This puts the call stubs first, which
in many cases makes some calls not so far, but also
enables trampolines to be generated when necessary.

This is a backport for go 1.8 based on CL38131.

Fixes #19578

Change-Id: If3ba3d5222a7f7969ed2de1df4854a1b4a80a0f0
Reviewed-on: https://go-review.googlesource.com/38472
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-03-23 15:39:24 +00:00
Steve Francia
0a5cec792f [release-branch.go1.8] doc: reorganize the contribution guidelines into a guide
Updates #17802

Change-Id: I65ea0f4cde973604c04051e7eb25d12e4facecd3
Reviewed-on: https://go-review.googlesource.com/36626
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
Reviewed-on: https://go-review.googlesource.com/38312
2017-03-16 21:47:46 +00:00
Alberto Donizetti
8890527476 [release-branch.go1.8] time: make the ParseInLocation test more robust
The tzdata 2017a update (2017-02-28) changed the abbreviation of the
Asia/Baghdad time zone (used in TestParseInLocation) from 'AST' to the
numeric '+03'.

Update the test so that it skips the checks if we're using a recent
tzdata release.

Fixes #19457

Change-Id: I45d705a5520743a611bdd194dc8f8d618679980c
Reviewed-on: https://go-review.googlesource.com/37964
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
(cherry picked from commit 91563ced58)
Reviewed-on: https://go-review.googlesource.com/37991
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-09 18:52:38 +00:00
Mike Danese
ea6781bcd0 [release-branch.go1.8] crypto/tls: make Config.Clone also clone the GetClientCertificate field
Using GetClientCertificate with the http client is currently completely
broken because inside the transport we clone the tls.Config and pass it
off to the tls.Client. Since tls.Config.Clone() does not pass forward
the GetClientCertificate field, GetClientCertificate is ignored in this
context.

Fixes #19264

Change-Id: Ie214f9f0039ac7c3a2dab8ffd14d30668bdb4c71
Signed-off-by: Mike Danese <mikedanese@google.com>
Reviewed-on: https://go-review.googlesource.com/37541
Reviewed-by: Filippo Valsorda <hi@filippo.io>
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
(cherry picked from commit 87649d32ad)
Reviewed-on: https://go-review.googlesource.com/37946
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Tom Bergan <tombergan@google.com>
2017-03-08 21:19:55 +00:00
Cherry Zhang
2327d696c1 [release-branch.go1.8] cmd/compile: do not fold offset into load/store for args on ARM64
Args may be not at 8-byte aligned offset to SP. When the stack
frame is large, folding the offset of args may cause large
unaligned offsets that does not fit in a machine instruction on
ARM64. Therefore disable folding offsets for args.

This has small performance impact (see below). A better fix would
be letting the assembler backend fix up the offset by loading it
into a register if it doesn't fit into an instruction. And the
compiler can simply generate large load/stores with offset. Since
in most of the cases the offset is aligned or the stack frame is
small, it can fit in an instruction and no fixup is needed. But
this is too complicated for Go 1.8.

name                     old time/op    new time/op    delta
BinaryTree17-8              8.30s ± 0%     8.31s ± 0%    ~     (p=0.579 n=10+10)
Fannkuch11-8                6.14s ± 0%     6.18s ± 0%  +0.53%  (p=0.000 n=9+10)
FmtFprintfEmpty-8           117ns ± 0%     117ns ± 0%    ~     (all equal)
FmtFprintfString-8          196ns ± 0%     197ns ± 0%  +0.72%  (p=0.000 n=10+10)
FmtFprintfInt-8             204ns ± 0%     205ns ± 0%  +0.49%  (p=0.000 n=9+10)
FmtFprintfIntInt-8          302ns ± 0%     307ns ± 1%  +1.46%  (p=0.000 n=10+10)
FmtFprintfPrefixedInt-8     329ns ± 2%     326ns ± 0%    ~     (p=0.083 n=10+10)
FmtFprintfFloat-8           540ns ± 0%     542ns ± 0%  +0.46%  (p=0.000 n=8+7)
FmtManyArgs-8              1.20µs ± 1%    1.19µs ± 1%  -1.02%  (p=0.000 n=10+10)
GobDecode-8                17.3ms ± 1%    17.8ms ± 0%  +2.75%  (p=0.000 n=10+7)
GobEncode-8                15.3ms ± 1%    15.4ms ± 0%  +0.57%  (p=0.004 n=9+10)
Gzip-8                      789ms ± 0%     803ms ± 0%  +1.78%  (p=0.000 n=9+10)
Gunzip-8                    128ms ± 0%     130ms ± 0%  +1.73%  (p=0.000 n=10+9)
HTTPClientServer-8          202µs ± 6%     201µs ±10%    ~     (p=0.739 n=10+10)
JSONEncode-8               42.0ms ± 0%    42.1ms ± 0%  +0.19%  (p=0.028 n=10+9)
JSONDecode-8                159ms ± 0%     161ms ± 0%  +1.05%  (p=0.000 n=9+10)
Mandelbrot200-8            10.1ms ± 0%    10.1ms ± 0%  -0.07%  (p=0.000 n=10+9)
GoParse-8                  8.46ms ± 1%    8.61ms ± 1%  +1.77%  (p=0.000 n=10+10)
RegexpMatchEasy0_32-8       227ns ± 1%     226ns ± 0%  -0.35%  (p=0.001 n=10+9)
RegexpMatchEasy0_1K-8      1.63µs ± 0%    1.63µs ± 0%  -0.13%  (p=0.000 n=10+9)
RegexpMatchEasy1_32-8       250ns ± 0%     249ns ± 0%  -0.40%  (p=0.001 n=8+9)
RegexpMatchEasy1_1K-8      2.07µs ± 0%    2.08µs ± 0%  +0.05%  (p=0.027 n=9+9)
RegexpMatchMedium_32-8      350ns ± 0%     350ns ± 0%    ~     (p=0.412 n=9+8)
RegexpMatchMedium_1K-8      104µs ± 0%     104µs ± 0%  +0.31%  (p=0.000 n=10+7)
RegexpMatchHard_32-8       5.82µs ± 0%    5.82µs ± 0%    ~     (p=0.937 n=9+9)
RegexpMatchHard_1K-8        176µs ± 0%     176µs ± 0%  +0.03%  (p=0.000 n=9+8)
Revcomp-8                   1.36s ± 1%     1.37s ± 1%    ~     (p=0.218 n=10+10)
Template-8                  151ms ± 1%     156ms ± 1%  +3.21%  (p=0.000 n=10+10)
TimeParse-8                 737ns ± 0%     758ns ± 2%  +2.74%  (p=0.000 n=10+10)
TimeFormat-8                801ns ± 2%     789ns ± 1%  -1.51%  (p=0.000 n=10+10)
[Geo mean]                  142µs          143µs       +0.50%

Fixes #19137.

Change-Id: Ib8a21ea98c0ffb2d282a586535b213cc163e1b67
Reviewed-on: https://go-review.googlesource.com/37251
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
(cherry picked from commit 6464e5dc4b)
Reviewed-on: https://go-review.googlesource.com/37719
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-03 22:24:40 +00:00
Cherry Zhang
ba48d2002e [release-branch.go1.8] cmd/compile: check both syms when folding address into load/store on ARM64
The rules for folding addresses into load/stores checks sym1 is
not on stack (because the stack offset is not known at that point).
But sym1 could be nil, which invalidates the check. Check merged
sym instead.

Fixes #19137.

Change-Id: I8574da22ced1216bb5850403d8f08ec60a8d1005
Reviewed-on: https://go-review.googlesource.com/37145
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
(cherry picked from commit 3557d54609)
Reviewed-on: https://go-review.googlesource.com/37214
2017-03-03 17:54:17 +00:00
Cherry Zhang
b43fabfb30 [release-branch.go1.8] cmd/compile: add zero-extension before right shift when lowering Lrot on ARM
Fixes #19270.

Change-Id: Ie7538ff8465138a8bc02572e84cf5d00de7bbdd1
Reviewed-on: https://go-review.googlesource.com/37718
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2017-03-03 17:45:10 +00:00
Michael Munday
6a712dfac1 [release-branch.go1.8] cmd/compile: fix merging of s390x conditional moves into branch conditions
A type conversion inserted between MOVD{LT,LE,GT,GE,EQ,NE} and CMPWconst
by CL 36256 broke the rewrite rule designed to merge the two.
This results in simple for loops (e.g. for i := 0; i < N; i++ {})
emitting two comparisons instead of one, plus a conditional move.

This CL explicitly types the input to CMPWconst so that the type conversion
can be omitted. It also adds a test to check that conditional moves aren't
emitted for loops with 'less than' conditions (i.e. i < N) on s390x.

Fixes #19227.

Change-Id: I44958eebf6c74c5819b2a9511caf3c47c20fbf45
Reviewed-on: https://go-review.googlesource.com/37536
Run-TryBot: Michael Munday <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bill O'Farrell <billotosyr@gmail.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-03-02 04:26:19 +00:00
Michael Munday
865536b197 [release-branch.go1.8] cmd/compile: remove unnecessary type conversions on s390x
Some rules insert MOVDreg ops to ensure that type changes are kept.
If there is no type change (or the input is constant) then the MOVDreg
can be omitted, allowing further optimization.

Reduces the size of the .text section in the asm tool by ~33KB.

For #19227.

Change-Id: I0f7b40d8dbcda73bca96eb6d2bf13f9ffa88f4b6
Reviewed-on: https://go-review.googlesource.com/37535
Run-TryBot: Michael Munday <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-03-02 04:25:56 +00:00
Russ Cox
bae53daa72 [release-branch.go1.8] runtime: avoid O(n) semaphore list walk in contention profiling
Contention profiling is off by default.
If you turn it on, it has the unfortunate effect of making
the wakeup on a contention mutex go from O(1) to O(n).
Change it back to O(1).

This is already fixed in essentially the same way on master;
master also contains some fixes for the non-profiling code
paths.

Possible for Go 1.8.1.

Change-Id: Iaa644c06e20ca28da4dfa348b7211eedb657e0ba
Reviewed-on: https://go-review.googlesource.com/37341
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-02-27 17:34:28 +00:00
Russ Cox
0954fdd51e [dev.typealias] set version to go1.8.typealias, including new build tag
This will keep toolchains built on this branch from pretending
to support whatever new things are coming in Go 1.9.

Change-Id: I3e0b623be57c3ad7e01f32abf148d181e3dc1fec
Reviewed-on: https://go-review.googlesource.com/37510
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-27 15:41:51 +00:00
Alberto Donizetti
d4ee1f4a40 [release-branch.go1.8] website: mention go1.8 in project page
Fixes #19253

Change-Id: Ia473f51bfe4cf42cf64938993a81d9b1dbc2594d
Reviewed-on: https://go-review.googlesource.com/37433
Reviewed-by: Chris Broadfoot <cbro@golang.org>
Reviewed-on: https://go-review.googlesource.com/37398
2017-02-23 19:21:10 +00:00
Brad Fitzpatrick
991ee8f4ac [release-branch.go1.8] doc: fix broken link in go1.8.html
Fixes #19244

Change-Id: Ia6332941b229c83d6fd082af49f31003a66b90db
Reviewed-on: https://go-review.googlesource.com/37388
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-on: https://go-review.googlesource.com/37397
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-02-23 19:19:58 +00:00
Russ Cox
3b4fc5d1c6 [dev.typealias] all: merge go1.8 into dev.typealias
This should provide a way for people who want to try
"Go 1.8 with type aliases" to do so.

Removed go1.8 VERSION file as part of merge.

Change-Id: I60d79439677d9980de7b5575e2e6cb9c23be02b6
2017-02-16 19:45:42 -05:00
Chris Broadfoot
cd6b6202dd [release-branch.go1.8] go1.8
Change-Id: If1e38f02db86449abd4c8a57988d9825b1cf2511
Reviewed-on: https://go-review.googlesource.com/37132
Run-TryBot: Chris Broadfoot <cbro@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-16 17:12:24 +00:00
Chris Broadfoot
606eb9b0c1 [release-branch.go1.8] doc: document go1.8
Change-Id: Ie2144d001c6b4b2293d07b2acf62d7e3cd0b46a7
Reviewed-on: https://go-review.googlesource.com/37130
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-on: https://go-review.googlesource.com/37131
2017-02-16 16:41:41 +00:00
Russ Cox
bcda91c18d [release-branch.go1.8] runtime: do not call wakep from enlistWorker, to avoid possible deadlock
We have seen one instance of a production job suddenly spinning to
100% CPU and becoming unresponsive. In that one instance, a SIGQUIT
was sent after 328 minutes of spinning, and the stacks showed a single
goroutine in "IO wait (scan)" state.

Looking for things that might get stuck if a goroutine got stuck in
scanning a stack, we found that injectglist does:

	lock(&sched.lock)
	var n int
	for n = 0; glist != nil; n++ {
		gp := glist
		glist = gp.schedlink.ptr()
		casgstatus(gp, _Gwaiting, _Grunnable)
		globrunqput(gp)
	}
	unlock(&sched.lock)

and that casgstatus spins on gp.atomicstatus until the _Gscan bit goes
away. Essentially, this code locks sched.lock and then while holding
sched.lock, waits to lock gp.atomicstatus.

The code that is doing the scan is:

	if castogscanstatus(gp, s, s|_Gscan) {
		if !gp.gcscandone {
			scanstack(gp, gcw)
			gp.gcscandone = true
		}
		restartg(gp)
		break loop
	}

More analysis showed that scanstack can, in a rare case, end up
calling back into code that acquires sched.lock. For example:

	runtime.scanstack at proc.go:866
	calls runtime.gentraceback at mgcmark.go:842
	calls runtime.scanstack$1 at traceback.go:378
	calls runtime.scanframeworker at mgcmark.go:819
	calls runtime.scanblock at mgcmark.go:904
	calls runtime.greyobject at mgcmark.go:1221
	calls (*runtime.gcWork).put at mgcmark.go:1412
	calls (*runtime.gcControllerState).enlistWorker at mgcwork.go:127
	calls runtime.wakep at mgc.go:632
	calls runtime.startm at proc.go:1779
	acquires runtime.sched.lock at proc.go:1675

This path was found with an automated deadlock-detecting tool.
There are many such paths but they all go through enlistWorker -> wakep.

The evidence strongly suggests that one of these paths is what caused
the deadlock we observed. We're running those jobs with
GOTRACEBACK=crash now to try to get more information if it happens
again.

Further refinement and analysis shows that if we drop the wakep call
from enlistWorker, the remaining few deadlock cycles found by the tool
are all false positives caused by not understanding the effect of calls
to func variables.

The enlistWorker -> wakep call was intended only as a performance
optimization, it rarely executes, and if it does execute at just the
wrong time it can (and plausibly did) cause the deadlock we saw.

Comment it out, to avoid the potential deadlock.

Fixes #19112.
Unfixes #14179.

Change-Id: I6f7e10b890b991c11e79fab7aeefaf70b5d5a07b
Reviewed-on: https://go-review.googlesource.com/37093
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-on: https://go-review.googlesource.com/37022
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-02-16 15:25:04 +00:00
Sarah Adams
7d7a0a9d64 [release-branch.go1.8] doc: update Code of Conduct wording and scope
This change removes the punitive language and anonymous reporting mechanism
from the Code of Conduct document. Read on for the rationale.

More than a year has passed since the Go Code of Conduct was introduced.
In that time, there have been a small number (<30) of reports to the Working Group.
Some reports we handled well, with positive outcomes for all involved.
A few reports we handled badly, resulting in hurt feelings and a bad
experience for all involved.

On reflection, the reports that had positive outcomes were ones where the
Working Group took the role of advisor/facilitator, listening to complaints and
providing suggestions and advice to the parties involved.
The reports that had negative outcomes were ones where the subject of the
report felt threatened by the Working Group and Code of Conduct.

After some discussion among the Working Group, we saw that we are most
effective as facilitators, rather than disciplinarians. The various Go spaces
already have moderators; this change to the CoC acknowledges their authority
and places the group in a purely advisory role. If an incident is
reported to the group we may provide information to or make a
suggestion the moderators, but the Working Group need not (and should not) have
any authority to take disciplinary action.

In short, we want it to be clear that the Working Group are here to help
resolve conflict, period.

The second change made here is the removal of the anonymous reporting mechanism.
To date, the quality of anonymous reports has been low, and with no way to
reach out to the reporter for more information there is often very little we
can do in response. Removing this one-way reporting mechanism strengthens the
message that the Working Group are here to facilitate a constructive dialogue.

Change-Id: Iee52aff5446accd0dae0c937bb3aa89709ad5fb4
Reviewed-on: https://go-review.googlesource.com/37014
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-on: https://go-review.googlesource.com/37040
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-02-15 21:51:35 +00:00
Russ Cox
cedc511a6e [release-branch.go1.8] encoding/xml: fix incorrect indirect code in chardata, comment, innerxml fields
The new tests in this CL have been checked against Go 1.7 as well
and all pass in Go 1.7, with the one exception noted in a comment
(an intentional change to omitempty already present before this CL).

CL 15684 made the intentional change to omitempty.
This CL fixes bugs introduced along the way.

Most of these are corner cases that are arguably not that important,
but they've always worked all the way back to Go 1, and someone
cared enough to file #19063. The most significant problem found
while adding tests is that in the case of a nil *string field with
`xml:",chardata"`, the existing code silently stops processing not just
that field but the entire remainder of the struct.
Even if #19063 were not worth fixing, this chardata bug would be.

Fixes #19063.

Change-Id: I318cf8f9945e1a4615982d9904e109fde577ebf9
Reviewed-on: https://go-review.googlesource.com/36954
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 72aa757ddd)
Reviewed-on: https://go-review.googlesource.com/37016
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2017-02-15 14:31:02 +00:00
Daniel Theophanes
ae13ccfd6d [release-branch.go1.8] database/sql: convert test timeouts to explicit waits with checks
When testing context cancelation behavior do not rely on context
timeouts. Use explicit checks in all such tests. In closeDB
convert the simple check for zero open conns with a wait loop
for zero open conns.

Fixes #19024
Fixes #19041

Change-Id: Iecfcc4467e91249fceb21ffd1f7c62c58140d8e9
Reviewed-on: https://go-review.googlesource.com/36902
Run-TryBot: Daniel Theophanes <kardianos@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-on: https://go-review.googlesource.com/36917
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Daniel Theophanes <kardianos@gmail.com>
2017-02-13 19:22:34 +00:00
Michael Hudson-Doyle
7cec9a583d [release-branch.go1.8] reflect: clear ptrToThis in Ptr when allocating result on heap
Otherwise, calling PtrTo on the result will fail.

Fixes #19003

Change-Id: I8d7d1981a5d0417d5aee52740469d71e90734963
Reviewed-on: https://go-review.googlesource.com/36731
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-on: https://go-review.googlesource.com/36718
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-10 17:53:40 +00:00
Daniel Theophanes
d84dee069a [release-branch.go1.8] database/sql: ensure driverConns are closed if not returned to pool
Previously if a connection was requested but timed out during the
request and when acquiring the db.Lock the connection request
is fulfilled and the request is unable to be returned to the
connection pool, then then driver connection would not be closed.

No tests were added or modified because I was unable to determine
how to trigger this situation without something invasive.

Change-Id: I9d4dc680e3fdcf63d79d212174a5b8b313f363f1
Reviewed-on: https://go-review.googlesource.com/36641
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-on: https://go-review.googlesource.com/36714
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-10 17:53:36 +00:00
Daniel Theophanes
f1e44a4b74 [release-branch.go1.8] database/sql: do not exhaust connection pool on conn request timeout
Previously if a context was canceled while it was waiting for a
connection request, that connection request would leak.

To prevent this remove the pending connection request if the
context is canceled and ensure no connection has been sent on the channel.
This requires a change to how the connection requests are represented in the DB.

Fixes #18995

Change-Id: I9a274b48b8f4f7ca46cdee166faa38f56d030852
Reviewed-on: https://go-review.googlesource.com/36563
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/36613
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-10 17:53:29 +00:00
Daniel Theophanes
3ade54063e [release-branch.go1.8] database/sql: record the context error in Rows if canceled
Previously it was intended that Rows.Scan would return
an error and Rows.Err would return nil. This was problematic
because drivers could not differentiate between a normal
Rows.Close or a context cancel close.

The alternative is to require drivers to return a Scan to return
an error if the driver is closed while there are still rows to be read.
This is currently not how several drivers currently work and may be
difficult to detect when there are additional rows.

At the same time guard the the Rows.lasterr and prevent a close
while a Rows operation is active.

For the drivers that do not have Context methods, do not check for
context cancelation after the operation, but before for any operation
that may modify the database state.

Fixes #18961

Change-Id: I49a25318ecd9f97a35d5b50540ecd850c01cfa5e
Reviewed-on: https://go-review.googlesource.com/36485
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/36614
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-09 03:47:26 +00:00
Russ Cox
0545006bdb [release-branch.go1.8] crypto/x509: check for new tls-ca-bundle.pem last
We added CentOS 7's /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
to the list in response to #17549 - not being able to find any certs otherwise.

Now we have #18813, where CentOS 6 apparently has both that file
and /etc/pki/tls/certs/ca-bundle.crt, and the latter is complete while
the former is not.

Moving the new CentOS 7 file to the bottom of the list should fix both
problems: the CentOS 7 system that didn't have any of the other files
in the list will still find the new one, and existing systems will still
keep using what they were using instead of preferring the new path
that may or may not be complete on some systems.

Fixes #18813.

Change-Id: I5275ab67424b95e7210e14938d3e986c8caee0ba
Reviewed-on: https://go-review.googlesource.com/36429
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
Reviewed-on: https://go-review.googlesource.com/36530
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-08 17:50:39 +00:00
Russ Cox
1363eeba65 [release-branch.go1.8] cmd/go, go/build: better defenses against GOPATH=GOROOT
Fixes #18863.

Change-Id: I0723563cd23728b0d43ebcc25979bf8d21e2a72c
Reviewed-on: https://go-review.googlesource.com/36427
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/36536
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-02-07 19:42:47 +00:00
Cherry Zhang
1edfd64761 [release-branch.go1.8] cmd/compile: do not use "oaslit" for global
The compiler did not emit write barrier for assigning global with
struct literal, like global = T{} where T contains pointer.

The relevant code path is:
walkexpr OAS var_ OSTRUCTLIT
    oaslit
        anylit OSTRUCTLIT
            walkexpr OAS var_ nil
            return without adding write barrier
    return true
break (without adding write barrier)

This CL makes oaslit not apply to globals. See also CL
https://go-review.googlesource.com/c/36355/ for an alternative
fix.

The downside of this is that it generates static data for zeroing
struct now. Also this only covers global. If there is any lurking
bug with implicit zeroing other than globals, this doesn't fix.

Fixes #18956.

Change-Id: Ibcd27e4fae3aa38390ffa94a32a9dd7a802e4b37
Reviewed-on: https://go-review.googlesource.com/36410
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
(cherry picked from commit 160914e33c)
Reviewed-on: https://go-review.googlesource.com/36531
2017-02-07 17:39:16 +00:00
Robert Griesemer
6eb0f5440e [release-branch.go1.8] cmd/compile/internal/syntax: avoid follow-up error for incorrect if statement
This is a follow-up on https://go-review.googlesource.com/36470
and leads to a more stable fix. The above CL relied on filtering
of multiple errors on the same line to avoid more than one error
for an `if` statement of the form `if a := 10 {}`. This CL avoids
the secondary error ("missing condition in if statement") in the
first place.

For #18915.

Change-Id: I8517f485cc2305965276c17d8f8797d61ef9e999
Reviewed-on: https://go-review.googlesource.com/36479
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-on: https://go-review.googlesource.com/36424
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2017-02-07 16:52:00 +00:00
Robert Griesemer
c543cc353d [release-branch.go1.8] cmd/compile/internal/syntax: make a parser error "1.7 compliant"
For code such as

	if a := 10 { ...

the 1.7 compiler reported

	a := 10 used as value

while the 1.8 compiler reported

	invalid condition, tag, or type switch guard

Changed the error message to match the 1.7 compiler.

Fixes #18915.

Change-Id: I01308862e461922e717f9f8295a9db53d5a914eb
Reviewed-on: https://go-review.googlesource.com/36470
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/36422
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2017-02-07 16:51:22 +00:00
David Crawshaw
f0749fe163 [release-branch.go1.8] cmd/link: use external linking for PIE by default
Now `go test -buildmode=pie std -short` passes on linux/amd64.

Updates #18968

Change-Id: Ide21877713e00edc64c1700c950016d6bff8de0e
Reviewed-on: https://go-review.googlesource.com/36417
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/36421
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
2017-02-07 01:40:49 +00:00
Andrew Gerrand
ba878ac0c8 [release-branch.go1.8] doc: remove inactive members of the CoC working group
Dave and Jason have moved on to other things.

Change-Id: I702d11bedfab1f47a33679a48c2309f49021229e
Reviewed-on: https://go-review.googlesource.com/36450
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-on: https://go-review.googlesource.com/36474
Reviewed-by: Andrew Gerrand <adg@golang.org>
2017-02-07 01:17:07 +00:00
Russ Cox
6177f6d448 [release-branch.go1.8] vendor/golang.org/x/crypto/curve25519: avoid loss of R15 in -dynlink mode
Original code fixed in https://go-review.googlesource.com/#/c/36359/.

Fixes #18820.

Change-Id: I060e6c9d0e312b4fd5d0674aff131055bf5cf61d
Reviewed-on: https://go-review.googlesource.com/36412
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
Reviewed-on: https://go-review.googlesource.com/36414
Reviewed-by: Austin Clements <austin@google.com>
2017-02-06 21:57:50 +00:00
Cherry Zhang
67cd1fa780 [release-branch.go1.8] cmd/compile: do not fold large offset on ARM64
Fixes #18933.

Change-Id: I1ab524fdca006100ec6af572065b496f68d6a5c3
Reviewed-on: https://go-review.googlesource.com/36413
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-06 21:23:08 +00:00
Michael Munday
758a7281ab [release-branch.go1.8] cmd/compile: fix type propagation through s390x SSA rules
This CL fixes two issues:

1. Load ops were initially always lowered to unsigned loads, even
   for signed types. This was fine by itself however LoadReg ops
   (used to re-load spilled values) were lowered to signed loads
   for signed types. This meant that spills could invalidate
   optimizations that assumed the original unsigned load.

2. Types were not always being maintained correctly through rules
   designed to eliminate unnecessary zero and sign extensions.

Updates #18906 and fixes #18958 (backport of CL 36256 to 1.8).

Change-Id: Id44953b0f644cad047e8474edbd24e8a344ca9a7
Reviewed-on: https://go-review.googlesource.com/36350
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-06 16:41:29 +00:00
Alberto Donizetti
470704531d [release-branch.go1.8] testing: stop timeout-timer after running tests
Fixes #18845

Fixes #18870 (Go 1.8 backport)

Change-Id: Icdc3e2067807781e42f2ffc94d1824aed94d3713
Reviewed-on: https://go-review.googlesource.com/35956
Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
(cherry picked from commit 7d8bfdde45)
Reviewed-on: https://go-review.googlesource.com/36125
2017-02-02 06:51:54 +00:00
Filippo Valsorda
648bb34484 [release-branch.go1.8] doc: mention SHA-256 CBC suites are off by default
Change-Id: I82c41bd1d82adda457ddb5dd08caf0647905da22
Reviewed-on: https://go-review.googlesource.com/36091
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit de479267ef)
Reviewed-on: https://go-review.googlesource.com/36130
2017-02-01 21:37:57 +00:00
Russ Cox
d8d2f036a5 [release-branch.go1.8] all: final merge of master into Go 1.8 release branch
After this, we will merge some of the dev work like
type aliases and inlining into master, so any additional
changes for the Go 1.8 release will need to be cherry-picked,
not merged.

3e55059f cmd/dist: really skip the testsanitizers tests on Android
09496599 runtime: add explicit (void) in C to avoid GCC 7 problem
4cffe2b6 cmd/dist: use the target GOOS to skip the test for issue 18153
6bdb0c11 doc: update go1.8 release notes after TxOptions change
09096bd3 cmd/go: update alldocs after CL 35150
96ea0918 cmd/compile: use CMPWU for 32-bit or smaller unsigned Geq on ppc64{,le}
21a8db1c doc: document go1.7.5

Change-Id: I9e6a30c3fac43d4d4d15e93054ac00964c3ee958
2017-01-31 09:53:37 -05:00
Chris Broadfoot
2a5f65a98c [release-branch.go1.8] go1.8rc3
Change-Id: Ie306bb5355f56113356fc141f3c1a56872b39f9e
Reviewed-on: https://go-review.googlesource.com/35836
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-01-26 17:42:08 +00:00
Chris Broadfoot
2f6c20b46c [release-branch.go1.8] all: merge master into release-branch.go1.8
78860b2ad2 cmd/go: don't reject ./... matching top-level file outside GOPATH
2b283cedef database/sql: fix race when canceling queries immediately
1cf08182f9 go/printer: fix format with leading comments in composite literal
b531eb3062 runtime: reorder modules so main.main comes first
165cfbc409 database/sql: let tests wait for db pool to come to expected state
ea73649343 doc: update gccgo docs
1db16711f5 doc: clarify what to do with Go 1.4 when installing from source
3717b429f2 doc: note that plugins are not fully baked
98842cabb6 net/http: don't send body on redirects for 301, 302, 303 when GetBody is set
314180e7f6 net/http: fix a nit
aad06da2b9 cmd/link: mark DWARF function symbols as reachable
be9dcfec29 doc: mention testing.MainStart signature change
a96e117a58 runtime: amd64, use 4-byte ops for memmove of 4 bytes
4cce27a3fa cmd/compile: fix constant propagation through s390x MOVDNE instructions
1be957d703 misc/cgo/test: pass current environment to syscall.Exec
ec654e2251 misc/cgo/test: fix test when using GCC 7
256a605faa cmd/compile: don't use nilcheck information until the next block
e8d5989ed1 cmd/compile: fix compilebench -alloc
ea7d9e6a52 runtime: check for nil g and m in msanread

Change-Id: I61d508d4f0efe4b72e7396645c8ad6088d2bfa6e
2017-01-26 09:24:31 -08:00
Chris Broadfoot
59f181b6fd [release-branch.go1.8] go1.8rc2
Change-Id: Ifcf2e13b962aa10280df8ca76cb21b37e3533f8f
Reviewed-on: https://go-review.googlesource.com/35475
Run-TryBot: Chris Broadfoot <cbro@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-01-19 20:58:37 +00:00
Chris Broadfoot
d18087cb25 [release-branch.go1.8] all: merge master into release-branch.go1.8
6593d8650d go/ast: fix Object's doc comment about Data
c1730ae424 runtime: force workers out before checking mark roots
d10eddcba3 testing: make parallel t.Run safe again
2c8b70eacf crypto/x509: revert SystemCertPool implementation for Windows
fcfd91858b doc/go1.8: document Plan 9 requirements
81a61a96c9 runtime: for plugins, don't add duplicate itabs
f674537cc9 README.md: update and simplify
d8711919db cmd/go: fix bug help message
48d8edb5b2 crypto/tls: disable CBC cipher suites with SHA-256 by default
92ecd78933 cmd/compile: add ZeroWB case in writebarrier
787125abab doc: 2017 is the Year of the Gopher
5b708a6b6a cmd/compile: lvalues are only required for == when calling runtime fns
e83d506714 vendor/golang_org/x/crypto/poly1305: revendor to pick up fix for #18673
76f981c8d8 net/http: skip TestServerHijackGetsBackgroundByte on Plan 9
e395e3246a net/http: skip TestServerHijackGetsBackgroundByte_big on Plan 9
6a3c6c0de8 net/http: add another hijack-after-background-read test
467109bf56 all: test adjustments for the iOS builder
b2a3b54b95 net/http: make sure Hijack's bufio.Reader includes pre-read background byte
593ea3b360 cmd/go, misc: rework cwd handling for iOS tests
0642b8a2f1 syscall: export Fsid.X__val on s390x
4601eae6ba doc/gdb: mention GOTRACEBACK=crash
4c4c5fc7a3 misc/cgo/testplugin: test that types and itabs are unique
22689c4450 reflect: keep makeFuncImpl live across makeFuncStub
9cf06ed6cd cmd/link: only exclude C-only symbols on darwin
9c3630f578 compress/flate: avoid large stack growth in fillDeflate
4f0aac52d9 cmd/go: add comment about SIGUSR2 on iOS
333f764df3 cmd/go, misc: switch from breakpoint to SIGUSR2
39e31d5ec0 doc/go1.8: update timezone database version
08da8201ca misc/cgo/testshared: test that types and itabs are unique
fdde7ba2a2 runtime: avoid clobbering C callee-save register in cgoSigtramp
f65abf6ddc cmd/compile: hide testdclstack behind debug flag
641ef2a733 compress/gzip: skip TestGZIPFilesHaveZeroMTimes on non-builders
0724aa813f crypto/dsa: gofmt
ac05542985 net/http: deflake TestRetryIdempotentRequestsOnError
b842c9aac7 doc: remove inline styles

Change-Id: I642c056732fe1e8081e9d73e086e38ea0b2568cc
2017-01-19 12:36:53 -08:00
Chris Broadfoot
3de6e96e4b [release-branch.go1.8] go1.8rc1
Change-Id: I68a99a4d750357dd59eb48f7c05b4dc08c64c92d
Reviewed-on: https://go-review.googlesource.com/35097
Run-TryBot: Chris Broadfoot <cbro@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-01-10 19:35:03 +00:00
2029 changed files with 91335 additions and 242810 deletions

View File

@@ -7,7 +7,6 @@ Please answer these questions before submitting your issue. Thanks!
### What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

6
.gitignore vendored
View File

@@ -31,9 +31,9 @@ _testmain.go
/pkg/
/src/*.*/
/src/cmd/cgo/zdefaultcc.go
/src/cmd/go/internal/cfg/zdefaultcc.go
/src/cmd/go/internal/cfg/zosarch.go
/src/cmd/internal/objabi/zbootstrap.go
/src/cmd/go/zdefaultcc.go
/src/cmd/go/zosarch.go
/src/cmd/internal/obj/zbootstrap.go
/src/go/build/zcgo.go
/src/go/doc/headscan
/src/runtime/internal/sys/zversion.go

184
AUTHORS
View File

@@ -16,17 +16,14 @@ Aaron France <aaron.l.france@gmail.com>
Aaron Torres <tcboox@gmail.com>
Abe Haskins <abeisgreat@abeisgreat.com>
Abhinav Gupta <abhinav.g90@gmail.com>
Adam Eijdenberg <adam@continusec.com>
Adrian Nos <nos.adrian@gmail.com>
Adrian O'Grady <elpollouk@gmail.com>
Adrien Bustany <adrien-xx-google@bustany.org>
Aécio Júnior <aeciodantasjunior@gmail.com>
Agis Anastasopoulos <agis.anast@gmail.com>
Ahmed Waheed Moanes <oneofone@gmail.com>
Ahmy Yulrizka <yulrizka@gmail.com>
Aiden Scandella <ai@uber.com>
Ainar Garipov <gugl.zadolbal@gmail.com>
Aishraj Dahal <aishraj@users.noreply.github.com>
Akihiro Suda <suda.kyoto@gmail.com>
Akshat Kumar <seed@mail.nanosouffle.net>
Alan Shreve <alan@inconshreveable.com>
@@ -49,9 +46,6 @@ Alex Schroeder <alex@gnu.org>
Alex Sergeyev <abc@alexsergeyev.com>
Alexander Demakin <alexander.demakin@gmail.com>
Alexander Döring <email@alexd.ch>
Alexander Guz <kalimatas@gmail.com>
Alexander Kauer <alexander@affine.space>
Alexander Kucherenko <alxkchr@gmail.com>
Alexander Larsson <alexander.larsson@gmail.com>
Alexander Menzhinsky <amenzhinsky@gmail.com>
Alexander Morozov <lk4d4math@gmail.com>
@@ -66,9 +60,7 @@ Alexandre Fiori <fiorix@gmail.com>
Alexandre Normand <alexandre.normand@gmail.com>
Alexei Sholik <alcosholik@gmail.com>
Alexey Borzenkov <snaury@gmail.com>
Alexey Neganov <neganovalexey@gmail.com>
Alexey Palazhchenko <alexey.palazhchenko@gmail.com>
Alexis Hildebrandt <surryhill@gmail.com>
Aliaksandr Valialkin <valyala@gmail.com>
Alif Rachmawadi <subosito@gmail.com>
Allan Simon <allan.simon@supinfo.com>
@@ -76,7 +68,6 @@ Alok Menghrajani <alok.menghrajani@gmail.com>
Amazon.com, Inc
Amir Mohammad Saied <amir@gluegadget.com>
Amrut Joshi <amrut.joshi@gmail.com>
Anders Pearson <anders@columbia.edu>
Andre Nathan <andrenth@gmail.com>
Andreas Auernhammer <aead@mail.de>
Andreas Litt <andreas.litt@gmail.com>
@@ -84,7 +75,6 @@ Andrei Korzhevskii <a.korzhevskiy@gmail.com>
Andrei Vieru <euvieru@gmail.com>
Andrew Austin <andrewaclt@gmail.com>
Andrew Balholm <andybalholm@gmail.com>
Andrew Benton <andrewmbenton@gmail.com>
Andrew Bonventre <andybons@chromium.org>
Andrew Bursavich <abursavich@gmail.com>
Andrew Ekstedt <andrew.ekstedt@gmail.com>
@@ -114,13 +104,9 @@ Anthony Canino <anthony.canino1@gmail.com>
Anthony Eufemio <anthony.eufemio@gmail.com>
Anthony Martin <ality@pbrane.org>
Anthony Starks <ajstarks@gmail.com>
Anthony Voutas <voutasaurus@gmail.com>
Anthony Woods <awoods@raintank.io>
Antoine Martin <antoine97.martin@gmail.com>
Antonio Bibiano <antbbn@gmail.com>
Antonio Troina <thoeni@gmail.com>
Apisak Darakananda <pongad@gmail.com>
Apsalar
Aram Hăvărneanu <aram@mgk.ro>
Areski Belaid <areski@gmail.com>
Arlo Breault <arlolra@gmail.com>
@@ -140,11 +126,9 @@ awaw fumin <awawfumin@gmail.com>
Ayanamist Yang <ayanamist@gmail.com>
Aymerick Jéhanne <aymerick@jehanne.org>
Baiju Muthukadan <baiju.m.mail@gmail.com>
Bartosz Grzybowski <melkorm@gmail.com>
Ben Burkert <ben@benburkert.com>
Ben Lubar <ben.lubar@gmail.com>
Ben Olive <sionide21@gmail.com>
Ben Shi <powerman1st@163.com>
Benjamin Black <b@b3k.us>
Benny Siegert <bsiegert@gmail.com>
Benoit Sigoure <tsunanet@gmail.com>
@@ -167,28 +151,20 @@ Brian Gitonga Marete <marete@toshnix.com> <bgmarete@gmail.com>
Brian Kennedy <btkennedy@gmail.com>
Brian Ketelsen <bketelsen@gmail.com>
Brian Smith <ohohvi@gmail.com>
Brian Starke <brian.starke@gmail.com>
Bryan Alexander <Kozical@msn.com>
Bryan Ford <brynosaurus@gmail.com>
Bulat Gaifullin <gaifullinbf@gmail.com>
Caine Tighe <arctanofyourface@gmail.com>
Caleb Spare <cespare@gmail.com>
Carl Chatfield <carlchatfield@gmail.com>
Carl Henrik Lunde <chlunde@ifi.uio.no>
Carl Johnson <me@carlmjohnson.net>
Carlisia Campos <carlisia@grokkingtech.io>
Carlo Alberto Ferraris <cafxx@strayorange.com>
Carlos Castillo <cookieo9@gmail.com>
Carlos Cirello <uldericofilho@gmail.com>
Carolyn Van Slyck <me@carolynvanslyck.com>
Case Nelson <case.nelson@gmail.com>
Casey Marshall <casey.marshall@gmail.com>
Cezar Sá Espinola <cezarsa@gmail.com>
ChaiShushan <chaishushan@gmail.com>
Charles L. Dorian <cldorian@gmail.com>
Charles Lee <zombie.fml@gmail.com>
Chew Choon Keat <choonkeat@gmail.com>
Chris Biscardi <chris@christopherbiscardi.com>
Chris Dollin <ehog.hedge@gmail.com>
Chris Farmiloe <chrisfarms@gmail.com>
Chris Hines <chris.cs.guy@gmail.com>
@@ -197,7 +173,6 @@ Chris Jones <chris@cjones.org>
Chris Kastorff <encryptio@gmail.com>
Chris Lennert <calennert@gmail.com>
Chris McGee <sirnewton_01@yahoo.ca> <newton688@gmail.com>
Chris Roche <rodaine@gmail.com>
Chris Stockton <chrisstocktonaz@gmail.com>
Christian Couder <chriscool@tuxfamily.org>
Christian Himpel <chressie@googlemail.com>
@@ -222,9 +197,7 @@ Corey Thomasson <cthom.lists@gmail.com>
Cristian Staretu <unclejacksons@gmail.com>
Currant
Cyrill Schumacher <cyrill@schumacher.fm>
Daisuke Fujita <dtanshi45@gmail.com>
Damian Gryski <dgryski@gmail.com>
Damien Lespiau <damien.lespiau@gmail.com>
Dan Caddigan <goldcaddy77@gmail.com>
Dan Callahan <dan.callahan@gmail.com>
Dan Peterson <dpiddy@gmail.com>
@@ -240,11 +213,9 @@ Daniel Ortiz Pereira da Silva <daniel.particular@gmail.com>
Daniel Skinner <daniel@dasa.cc>
Daniel Speichert <daniel@speichert.pl>
Daniel Theophanes <kardianos@gmail.com>
Daniel Upton <daniel@floppy.co>
Darren Elwood <darren@textnode.com>
Datong Sun <dndx@idndx.com>
Dave Cheney <dave@cheney.net>
Dave MacFarlane <driusan@gmail.com>
David Brophy <dave@brophy.uk>
David Bürgin <676c7473@gmail.com>
David Calavera <david.calavera@gmail.com>
@@ -254,13 +225,11 @@ David G. Andersen <dave.andersen@gmail.com>
David Howden <dhowden@gmail.com>
David Jakob Fritz <david.jakob.fritz@gmail.com>
David Leon Gil <coruus@gmail.com>
David NewHamlet <david@newhamlet.com>
David R. Jenni <david.r.jenni@gmail.com>
David Sansome <me@davidsansome.com>
David Stainton <dstainton415@gmail.com>
David Thomas <davidthomas426@gmail.com>
David Titarenco <david.titarenco@gmail.com>
David Volquartz Lebech <david@lebech.info>
Davies Liu <davies.liu@gmail.com>
Dean Prichard <dean.prichard@gmail.com>
Deepak Jois <deepak.jois@gmail.com>
@@ -268,7 +237,6 @@ Denis Bernard <db047h@gmail.com>
Denis Brandolini <denis.brandolini@gmail.com>
Denys Honsiorovskyi <honsiorovskyi@gmail.com>
Derek Buitenhuis <derek.buitenhuis@gmail.com>
Derek McGowan <derek@mcgstyle.net>
Derek Parker <parkerderek86@gmail.com>
Derek Shockey <derek.shockey@gmail.com>
Develer SRL
@@ -286,7 +254,6 @@ Dmitriy Shelenin <deemok@googlemail.com> <deemok@gmail.com>
Dmitry Chestnykh <dchest@gmail.com>
Dmitry Savintsev <dsavints@gmail.com>
Dmitry Yakunin <nonamezeil@gmail.com>
Dominic Green <dominicgreen1@gmail.com>
Dominik Honnef <dominik.honnef@gmail.com>
Donald Huang <don.hcd@gmail.com>
Donovan Hide <donovanhide@gmail.com>
@@ -300,16 +267,13 @@ Eden Li <eden.li@gmail.com>
Edward Muller <edwardam@interlix.com>
Egon Elbre <egonelbre@gmail.com>
Ehren Kret <ehren.kret@gmail.com>
Eitan Adler <lists@eitanadler.com>
Eivind Uggedal <eivind@uggedal.com>
Elias Naur <elias.naur@gmail.com>
Elliot Morrison-Reed <elliotmr@gmail.com>
Emil Hessman <c.emil.hessman@gmail.com> <emil@hessman.se>
Emilien Kenler <hello@emilienkenler.com>
Emmanuel Odeke <emm.odeke@gmail.com> <odeke@ualberta.ca>
Empirical Interfaces Inc.
Eoghan Sherry <ejsherry@gmail.com>
Eric Chiang <eric.chiang.m@gmail.com>
Eric Clark <zerohp@gmail.com>
Eric Engestrom <eric@engestrom.ch>
Eric Lagergren <ericscottlagergren@gmail.com>
@@ -324,23 +288,16 @@ Esko Luontola <esko.luontola@gmail.com>
Euan Kemp <euank@euank.com>
Evan Phoenix <evan@phx.io>
Evan Shaw <chickencha@gmail.com>
Evgeniy Polyakov <zbr@ioremap.net>
Ewan Chou <coocood@gmail.com>
Ewan Valentine <ewan.valentine89@gmail.com>
Eyal Posener <posener@gmail.com>
Fabian Wickborn <fabian@wickborn.net>
Fabian Zaremba <fabian@youremail.eu>
Fabrizio Milo <mistobaan@gmail.com>
Facebook, Inc.
Faiyaz Ahmed <ahmedf@vmware.com>
Fan Hongjian <fan.howard@gmail.com>
Fastly, Inc.
Fatih Arslan <fatih@arslan.io>
Fazlul Shahriar <fshahriar@gmail.com>
Fedor Indutny <fedor@indutny.com>
Felipe Oliveira <felipeweb.programador@gmail.com>
Felix Geisendörfer <haimuiba@gmail.com>
Filip Gruszczyński <gruszczy@gmail.com>
Filippo Valsorda <hi@filippo.io>
Firmansyah Adiputra <frm.adiputra@gmail.com>
Florian Uekermann <florian@uekermann-online.de>
@@ -351,7 +308,6 @@ Francisco Claude <fclaude@recoded.cl>
Francisco Souza <franciscossouza@gmail.com>
Frederick Kelly Mayle III <frederickmayle@gmail.com>
Fredrik Enestad <fredrik.enestad@soundtrackyourbrand.com>
Fredrik Forsmo <fredrik.forsmo@gmail.com>
Frithjof Schulze <schulze@math.uni-hannover.de> <sfrithjof@gmail.com>
Frits van Bommel <fvbommel@gmail.com>
Gabriel Aszalos <gabriel.aszalos@gmail.com>
@@ -361,10 +317,8 @@ Gary Burd <gary@beagledreams.com>
Gaurish Sharma <contact@gaurishsharma.com>
Gautham Thambidorai <gautham.dorai@gmail.com>
Geert-Johan Riemer <gjr19912@gmail.com>
Gengliang Wang <ltnwgl@gmail.com>
Geoffroy Lorieux <lorieux.g@gmail.com>
Georg Reinke <guelfey@gmail.com>
George Gkirtsou <ggirtsou@gmail.com>
George Shammas <george@shamm.as> <georgyo@gmail.com>
Gerasimos Dimitriadis <gedimitr@gmail.com>
Gideon Jan-Wessel Redelinghuys <gjredelinghuys@gmail.com>
@@ -376,43 +330,35 @@ Gordon Klaus <gordon.klaus@gmail.com>
Graham King <graham4king@gmail.com>
Graham Miller <graham.miller@gmail.com>
Greg Ward <greg@gerg.ca>
Gregory Man <man.gregory@gmail.com>
Guillaume J. Charmes <guillaume@charmes.net>
Guobiao Mei <meiguobiao@gmail.com>
Gustav Paul <gustav.paul@gmail.com>
Gustav Westling <gustav@westling.xyz>
Gustavo Niemeyer <gustavo@niemeyer.net>
Gwenael Treguier <gwenn.kahz@gmail.com>
Gyu-Ho Lee <gyuhox@gmail.com>
H. İbrahim Güngör <igungor@gmail.com>
Hajime Hoshi <hajimehoshi@gmail.com>
Hang Qian <hangqian90@gmail.com>
Hari haran <hariharan.uno@gmail.com>
Hariharan Srinath <srinathh@gmail.com>
Harley Laue <losinggeneration@gmail.com>
Harry Moreno <morenoh149@gmail.com>
Harshavardhana <hrshvardhana@gmail.com>
Hauke Löffler <hloeffler@users.noreply.github.com>
Håvard Haugen <havard.haugen@gmail.com>
Hector Chu <hectorchu@gmail.com>
Hector Martin Cantero <hector@marcansoft.com>
Henning Schmiedehausen <henning@schmiedehausen.org>
Henrik Edwards <henrik.edwards@gmail.com>
Henrik Hodne <henrik@hodne.io>
Henry Chang <mr.changyuheng@gmail.com>
Herbert Georg Fischer <herbert.fischer@gmail.com>
Hironao OTSUBO <motemen@gmail.com>
Hiroshi Ioka <hirochachacha@gmail.com>
Hitoshi Mitake <mitake.hitoshi@gmail.com>
Holden Huang <ttyh061@gmail.com>
Hong Ruiqi <hongruiqi@gmail.com>
Hongfei Tan <feilengcui008@gmail.com>
Hsin-Ho Yeh <yhh92u@gmail.com>
Hu Keping <hukeping@huawei.com>
Hugues Bruant <hugues.bruant@gmail.com>
Ian Gudger <ian@loosescre.ws>
IBM
Ibrahim AshShohail <ibra.sho@gmail.com>
Icarus Sparry <golang@icarus.freeuk.com>
Idora Shinatose <idora.shinatose@gmail.com>
Igneous Systems, Inc.
@@ -431,32 +377,25 @@ Jakob Borg <jakob@nym.se>
Jakub Ryszard Czarnowicz <j.czarnowicz@gmail.com>
James Bardin <j.bardin@gmail.com>
James Clarke <jrtc27@jrtc27.com>
James Cowgill <James.Cowgill@imgtec.com>
James David Chalfant <james.chalfant@gmail.com>
James Fysh <james.fysh@gmail.com>
James Gray <james@james4k.com>
James Hartig <fastest963@gmail.com>
James Meneghello <rawrz0r@gmail.com>
James Myers <jfmyers9@gmail.com>
James Neve <jamesoneve@gmail.com>
James P. Cooper <jamespcooper@gmail.com>
James Schofield <james@shoeboxapp.com>
James Smith <jrs1995@icloud.com>
James Sweet <james.sweet88@googlemail.com>
James Toy <nil@opensesame.st>
James Whitehead <jnwhiteh@gmail.com>
Jamie Beverly <jamie.r.beverly@gmail.com>
Jamie Stackhouse <contin673@gmail.com>
Jamil Djadala <djadala@gmail.com>
Jan Berktold <jan@berktold.co>
Jan H. Hosang <jan.hosang@gmail.com>
Jan Mercl <0xjnml@gmail.com> <befelemepeseveze@gmail.com>
Jan Mercl <0xjnml@gmail.com>
Jan Mercl <befelemepeseveze@gmail.com>
Jan Newmarch <jan.newmarch@gmail.com>
Jan Ziak <0xe2.0x9a.0x9b@gmail.com>
Jani Monoses <jani.monoses@ubuntu.com>
Jaroslavas Počepko <jp@webmaster.ms>
Jason Barnett <jason.w.barnett@gmail.com>
Jason Chu <jasonchujc@gmail.com>
Jason Del Ponte <delpontej@gmail.com>
Jason Smale <jsmale@zendesk.com>
Jason Travis <infomaniac7@gmail.com>
@@ -466,7 +405,6 @@ Jeff Hodges <jeff@somethingsimilar.com>
Jeff R. Allen <jra@nella.org>
Jeff Sickel <jas@corpus-callosum.com>
Jeff Wendling <jeff@spacemonkey.com>
Jeffrey H <jeffreyh192@gmail.com>
Jens Frederich <jfrederich@gmail.com>
Jeremy Jackins <jeremyjackins@gmail.com>
Jeroen Bobbeldijk <jerbob92@gmail.com>
@@ -475,7 +413,6 @@ Jesse Szwedko <jesse.szwedko@gmail.com>
Jihyun Yu <yjh0502@gmail.com>
Jim McGrath <jimmc2@gmail.com>
Jimmy Zelinskie <jimmyzelinskie@gmail.com>
Jin-wook Jeong <jeweljar@hanmail.net>
Jingcheng Zhang <diogin@gmail.com>
Jingguo Yao <yaojingguo@gmail.com>
Jiong Du <londevil@gmail.com>
@@ -489,7 +426,6 @@ Joe Shaw <joe@joeshaw.org>
Joe Sylve <joe.sylve@gmail.com>
Joe Tsai <joetsai@digital-static.net>
Joel Stemmer <stemmertech@gmail.com>
Johan Brandhorst <johan.brandhorst@gmail.com>
Johan Sageryd <j@1616.se>
John Asmuth <jasmuth@gmail.com>
John C Barstow <jbowtie@amathaine.com>
@@ -505,24 +441,19 @@ Jonathan Boulle <jonathanboulle@gmail.com>
Jonathan Gold <jgold.bg@gmail.com>
Jonathan Mark <jhmark@xenops.com>
Jonathan Rudenberg <jonathan@titanous.com>
Jonathan Stacks <jonstacks13@gmail.com>
Jonathan Wills <runningwild@gmail.com>
Jongmin Kim <atomaths@gmail.com>
Joonas Kuorilehto <joneskoo@derbian.fi>
Joop Kiefte <ikojba@gmail.com> <joop@kiefte.net>
Jordan Krage <jmank88@gmail.com>
Jordan Lewis <jordanthelewis@gmail.com>
Jose Luis Vázquez González <josvazg@gmail.com>
Joseph Holsten <joseph@josephholsten.com>
Josh Bleecher Snyder <josharian@gmail.com>
Josh Chorlton <jchorlton@gmail.com>
Josh Deprez <josh.deprez@gmail.com>
Josh Goebel <dreamer3@gmail.com>
Josh Holland <jrh@joshh.co.uk>
Joshua Chase <jcjoshuachase@gmail.com>
Josselin Costanzi <josselin@costanzi.fr>
Jostein Stuhaug <js@solidsystem.no>
Joyent, Inc.
JT Olds <jtolds@xnet5.com>
Jukka-Pekka Kekkonen <karatepekka@gmail.com>
Julian Kornberger <jk+github@digineo.de>
@@ -531,20 +462,14 @@ Julien Schmidt <google@julienschmidt.com>
Justin Nuß <nuss.justin@gmail.com>
Justyn Temme <justyntemme@gmail.com>
Kai Backman <kaib@golang.org>
Kai Trukenmüller <ktye78@gmail.com>
Kale Blankenship <kale@lemnisys.com>
Kaleb Elwert <kelwert@atlassian.com>
Kamil Chmielewski <kamil.chm@gmail.com>
Kamil Kisiel <kamil@kamilkisiel.net> <kamil.kisiel@gmail.com>
Kang Hu <hukangustc@gmail.com>
Karoly Negyesi <chx1975@gmail.com>
Kashav Madan <kshvmdn@gmail.com>
Kato Kazuyoshi <kato.kazuyoshi@gmail.com>
Katrina Owen <katrina.owen@gmail.com>
Kaviraj Kanagaraj <kavirajkanagaraj@gmail.com>
Keegan Carruthers-Smith <keegan.csmith@gmail.com>
Kei Son <hey.calmdown@gmail.com>
Keiji Yoshida <keijiyoshida.mail@gmail.com>
Keith Ball <inflatablewoman@gmail.com>
Keith Rarick <kr@xph.us>
Kelsey Hightower <kelsey.hightower@gmail.com>
@@ -559,46 +484,29 @@ Kevin Ballard <kevin@sb.org>
Kevin Burke <kev@inburke.com>
Kevin Kirsche <kev.kirsche@gmail.com>
Kevin Vu <kevin.m.vu@gmail.com>
Kim Yongbin <kybinz@gmail.com>
Klaus Post <klauspost@gmail.com>
Kodie Goodwin <kodiegoodwin@gmail.com>
Koichi Shiraishi <zchee.io@gmail.com>
Koki Ide <niconegoto@yahoo.co.jp>
Konstantin <konstantin8105@gmail.com>
Konstantin Shaposhnikov <k.shaposhnikov@gmail.com>
KPCompass, Inc.
Kris Nova <kris@nivenly.com>
Kristopher Watts <traetox@gmail.com>
Kun Li <likunarmstrong@gmail.com>
Kyle Consalus <consalus@gmail.com>
Kyle Isom <kyle@gokyle.net>
Kyle Jones <kyle@kyledj.com>
Kyle Lemons <kyle@kylelemons.net>
Kyrylo Silin <silin@kyrylo.org>
L Campbell <unpantsu@gmail.com>
Lai Jiangshan <eag0628@gmail.com>
Lars Jeppesen <jeppesen.lars@gmail.com>
Lars Wiegman <lars@namsral.com>
Larz Conwell <larzconwell@gmail.com>
Laurie Clark-Michalek <laurie@qubit.com>
LE Manh Cuong <cuong.manhle.vn@gmail.com>
Lee Hinman <hinman@gmail.com>
Lee Packham <lpackham@gmail.com>
Leon Klingele <git@leonklingele.de>
Lev Shamardin <shamardin@gmail.com>
Lewin Bormann <lewin.bormann@gmail.com>
Liberty Fund Inc
Linaro Limited
Lion Yang <lion@aosc.xyz>
Lloyd Dewolf <foolswisdom@gmail.com>
Lorenzo Masini <rugginoso@develer.com>
Lorenzo Stoakes <lstoakes@gmail.com>
Luan Santos <cfcluan@gmail.com>
Luca Greco <luca.greco@alcacoop.it>
Lucas Bremgartner <lucas.bremgartner@gmail.com>
Lucien Stuker <lucien.stuker@gmail.com>
Lucio De Re <lucio.dere@gmail.com>
Ludi Rehak <ludi317@gmail.com>
Luigi Riefolo <luigi.riefolo@gmail.com>
Luit van Drongelen <luitvd@gmail.com>
Luka Zakrajšek <tr00.g33k@gmail.com>
@@ -610,15 +518,12 @@ Manu S Ajith <neo@codingarena.in>
Manuel Mendez <mmendez534@gmail.com>
Marc Weistroff <marc@weistroff.net>
Marcel Edmund Franke <marcel.edmund.franke@gmail.com>
Marcelo E. Magallon <marcelo.magallon@gmail.com>
Marco Hennings <marco.hennings@freiheit.com>
Marin Bašić <marin.basic02@gmail.com>
Mark Adams <mark@markadams.me>
Mark Bucciarelli <mkbucc@gmail.com>
Mark Severson <miquella@gmail.com>
Mark Theunissen <mark.theunissen@gmail.com>
Marko Juhani Silokunnas <marko.silokunnas@gmail.com>
Marko Mudrinic <mudrinic.mare@gmail.com>
Marko Tiikkaja <marko@joh.to>
Markover Inc. DBA Poptip
Markus Duft <markus.duft@salomon.at>
@@ -627,36 +532,23 @@ Markus Zimmermann <zimmski@gmail.com>
Martin Bertschler <mbertschler@gmail.com>
Martin Garton <garton@gmail.com>
Martin Hamrle <martin.hamrle@gmail.com>
Martin Hoefling <martin.hoefling@gmx.de>
Martin Lindhe <martin.j.lindhe@gmail.com>
Martin Möhrmann <martisch@uos.de>
Martin Neubauer <m.ne@gmx.net>
Martin Olsen <github.com@martinolsen.net>
Martin Olsson <martin@minimum.se>
Martin Probst <martin@probst.io>
Marvin Stenger <marvin.stenger94@gmail.com>
Marwan Sulaiman <marwan.sulaiman@work.co>
Masahiro Furudate <masahiro.furudate@gmail.com>
Masahiro Wakame <vvakame@gmail.com>
Masaki Yoshida <yoshida.masaki@gmail.com>
Máté Gulyás <mgulyas86@gmail.com>
Mateusz Czapliński <czapkofan@gmail.com>
Mathias Beke <git@denbeke.be>
Mathias Hall-Andersen <mathias@hall-andersen.dk>
Mathias Leppich <mleppich@muhqu.de>
Mathieu Lonjaret <mathieu.lonjaret@gmail.com>
Mats Lidell <mats.lidell@cag.se>
Matt Aimonetti <mattaimonetti@gmail.com>
Matt Blair <me@matthewblair.net>
Matt Bostock <matt@mattbostock.com>
Matt Drollette <matt@drollette.com>
Matt Harden <matt.harden@gmail.com>
Matt Jibson <matt.jibson@gmail.com>
Matt Joiner <anacrolix@gmail.com>
Matt Layher <mdlayher@gmail.com>
Matt Reiferson <mreiferson@gmail.com>
Matt Robenolt <matt@ydekproductions.com>
Matt Strong <mstrong1341@gmail.com>
Matt T. Proud <matt.proud@gmail.com>
Matt Williams <gh@mattyw.net>
Matthew Brennan <matty.brennan@gmail.com>
@@ -668,8 +560,6 @@ Matthieu Hauglustaine <matt.hauglustaine@gmail.com>
Matthieu Olivier <olivier.matthieu@gmail.com>
Max Riveiro <kavu13@gmail.com>
Maxim Khitrov <max@mxcrypt.com>
Maxime de Roucy <maxime.deroucy@gmail.com>
Máximo Cuadros Ortiz <mcuadros@gmail.com>
Maxwell Krohn <themax@gmail.com>
MediaMath, Inc
Meir Fischer <meirfischer@gmail.com>
@@ -695,7 +585,6 @@ Michal Bohuslávek <mbohuslavek@gmail.com>
Michał Derkacz <ziutek@lnet.pl>
Miek Gieben <miek@miek.nl>
Miguel Mendez <stxmendez@gmail.com>
Miguel Molina <hi@mvader.me>
Mihai Borobocea <MihaiBorobocea@gmail.com>
Mikael Tillenius <mikti42@gmail.com>
Mike Andrews <mra@xoba.com>
@@ -707,7 +596,6 @@ Mikhail Panchenko <m@mihasya.com>
Miki Tebeka <miki.tebeka@gmail.com>
Mikio Hara <mikioh.mikioh@gmail.com>
Mikkel Krautz <mikkel@krautz.dk>
Milutin Jovanović <jovanovic.milutin@gmail.com>
Miquel Sabaté Solà <mikisabate@gmail.com>
Miroslav Genov <mgenov@gmail.com>
Mohit Agarwal <mohit@sdf.org>
@@ -717,57 +605,42 @@ Moov Corporation
Moriyoshi Koizumi <mozo@mozo.jp>
Morten Siebuhr <sbhr@sbhr.dk>
Môshe van der Sterre <moshevds@gmail.com>
Mostyn Bramley-Moore <mostyn@antipode.se>
Muhammed Uluyol <uluyol0@gmail.com>
Mura Li <mura_li@castech.com.tw>
Nan Deng <monnand@gmail.com>
Nathan Caza <mastercactapus@gmail.com>
Nathan Humphreys <nkhumphreys@gmail.com>
Nathan John Youngman <nj@nathany.com>
Nathan Otterness <otternes@cs.unc.edu>
Nathan P Finch <nate.finch@gmail.com>
Nathan VanBenschoten <nvanbenschoten@gmail.com>
Nathan Youngman <git@nathany.com>
Nathaniel Cook <nvcook42@gmail.com>
Neelesh Chandola <neelesh.c98@gmail.com>
Neil Lyons <nwjlyons@googlemail.com>
Netflix, Inc.
Neuman Vong <neuman.vong@gmail.com>
Nevins Bartolomeo <nevins.bartolomeo@gmail.com>
Nexedi
ngmoco, LLC
Niall Sheridan <nsheridan@gmail.com>
Nic Day <nic.day@me.com>
Nicholas Katsaros <nick@nickkatsaros.com>
Nicholas Maniscalco <nicholas@maniscalco.com>
Nicholas Presta <nick@nickpresta.ca> <nick1presta@gmail.com>
Nicholas Sullivan <nicholas.sullivan@gmail.com>
Nicholas Waples <nwaples@gmail.com>
Nick Craig-Wood <nick@craig-wood.com> <nickcw@gmail.com>
Nick Leli <nicholasleli@gmail.com>
Nick Miyake <nmiyake@users.noreply.github.com>
Nick Patavalis <nick.patavalis@gmail.com>
Nick Petroni <npetroni@cs.umd.edu>
Nick Robinson <nrobinson13@gmail.com>
Nicolas Kaiser <nikai@nikai.net>
Nicolas Owens <mischief@offblast.org>
Nicolas S. Dade <nic.dade@gmail.com>
Niels Widger <niels.widger@gmail.com>
Nigel Kerr <nigel.kerr@gmail.com>
Nik Nyby <nnyby@columbia.edu>
Niklas Schnelle <niklas.schnelle@gmail.com>
Niko Dziemba <niko@dziemba.com>
Nikolay Turpitko <nikolay@turpitko.com>
Niranjan Godbole <niranjan8192@gmail.com>
Noah Campbell <noahcampbell@gmail.com>
Norberto Lopes <nlopes.ml@gmail.com>
Odin Ugedal <odin@ugedal.com>
Oleg Bulatov <dmage@yandex-team.ru>
Oleg Vakheta <helginet@gmail.com>
Oleku Konko <oleku.konko@gmail.com>
Oling Cat <olingcat@gmail.com>
Oliver Hookins <ohookins@gmail.com>
Oliver Tonnhofer <olt@bogosoft.com>
Olivier Antoine <olivier.antoine@gmail.com>
Olivier Duperray <duperray.olivier@gmail.com>
Olivier Poitrey <rs@dailymotion.com>
@@ -775,7 +648,6 @@ Olivier Saingre <osaingre@gmail.com>
Oracle
Orange
Özgür Kesim <oec-go@kesim.org>
Pablo Lalloni <plalloni@gmail.com>
Padraig Kitterick <padraigkitterick@gmail.com>
Palm Stone Games
Paolo Giarrusso <p.giarrusso@gmail.com>
@@ -788,14 +660,11 @@ Patrick Higgins <patrick.allen.higgins@gmail.com>
Patrick Lee <pattyshack101@gmail.com>
Patrick Mézard <patrick@mezard.eu>
Patrick Mylund Nielsen <patrick@patrickmn.com>
Patrick Pelletier <pp.pelletier@gmail.com>
Patrick Smith <pat42smith@gmail.com>
Paul A Querna <paul.querna@gmail.com>
Paul Hammond <paul@paulhammond.org>
Paul Jolly <paul@myitcv.org.uk>
Paul Lalonde <paul.a.lalonde@gmail.com>
Paul Meyer <paul.meyer@microsoft.com>
Paul Querna <pquerna@apache.org>
Paul Rosania <paul.rosania@gmail.com>
Paul Sbarra <Sbarra.Paul@gmail.com>
Paul Smith <paulsmith@pobox.com> <paulsmith@gmail.com>
@@ -803,19 +672,15 @@ Paul van Brouwershaven <paul@vanbrouwershaven.com>
Paulo Casaretto <pcasaretto@gmail.com>
Pavel Paulau <pavel.paulau@gmail.com>
Pavel Zinovkin <pavel.zinovkin@gmail.com>
Pavlo Sumkin <ymkins@gmail.com>
Pawel Knap <pawelknap88@gmail.com>
Percy Wegmann <ox.to.a.cart@gmail.com>
Perry Abbott <perry.j.abbott@gmail.com>
Petar Maymounkov <petarm@gmail.com>
Peter Armitage <peter.armitage@gmail.com>
Peter Bourgon <peter@bourgon.org>
Peter Froehlich <peter.hans.froehlich@gmail.com>
Peter Kleiweg <pkleiweg@xs4all.nl>
Peter Moody <pmoody@uber.com>
Peter Morjan <pmorjan@gmail.com>
Peter Mundy <go.peter.90@gmail.com>
Peter Nguyen <peter@mictis.com>
Péter Surányi <speter.go1@gmail.com>
Péter Szilágyi <peterke@gmail.com>
Peter Waldschmidt <peter@waldschmidt.com>
@@ -826,45 +691,34 @@ Philip Hofer <phofer@umich.edu>
Philip K. Warren <pkwarren@gmail.com>
Pierre Durand <pierredurand@gmail.com>
Pierre Roullon <pierre.roullon@gmail.com>
Piers <google@hellopiers.pro>
Pieter Droogendijk <pieter@binky.org.uk>
Pietro Gagliardi <pietro10@mac.com>
Prashant Varanasi <prashant@prashantv.com>
Pravendra Singh <hackpravj@gmail.com>
Preetam Jinka <pj@preet.am>
Qiuxuan Zhu <ilsh1022@gmail.com>
Quan Tran <qeed.quan@gmail.com>
Quan Yong Zhai <qyzhai@gmail.com>
Quentin Perez <qperez@ocs.online.net>
Quentin Renard <contact@asticode.com>
Quoc-Viet Nguyen <afelion@gmail.com>
RackTop Systems Inc.
Radu Berinde <radu@cockroachlabs.com>
Rafal Jeczalik <rjeczalik@gmail.com>
Raif S. Naffah <go@naffah-raif.name>
RainTank
Rajat Goel <rajat.goel2010@gmail.com>
Ralph Corderoy <ralph@inputplus.co.uk>
Raphael Geronimi <raphael.geronimi@gmail.com>
Ray Tung <rtung@thoughtworks.com>
Raymond Kazlauskas <raima220@gmail.com>
Red Hat, Inc.
Reinaldo de Souza Jr <juniorz@gmail.com>
Remi Gillig <remigillig@gmail.com>
Rémy Oudompheng <oudomphe@phare.normalesup.org>
Ricardo Padilha <ricardospadilha@gmail.com>
Richard Barnes <rlb@ipv.sx>
Richard Crowley <r@rcrowley.org>
Richard Dingwall <rdingwall@gmail.com>
Richard Eric Gavaletz <gavaletz@gmail.com>
Richard Gibson <richard.gibson@gmail.com>
Richard Miller <miller.research@gmail.com>
Richard Musiol <mail@richard-musiol.de>
Rick Arnold <rickarnoldjr@gmail.com>
Rick Sayre <whorfin@gmail.com>
Risto Jaakko Saarelma <rsaarelm@gmail.com>
Rob Norman <rob.norman@infinitycloud.com>
Rob Phoenix <rob@robphoenix.com>
Robert Daniel Kortschak <dan.kortschak@adelaide.edu.au>
Robert Dinu <r@varp.se>
Robert Figueiredo <robfig@gmail.com>
@@ -883,21 +737,17 @@ Ross Light <rlight2@gmail.com>
Rowan Worth <sqweek@gmail.com>
Russell Haering <russellhaering@gmail.com>
Ryan Bagwell <ryanbagwell@outlook.com>
Ryan Boehning <ryan.boehning@apcera.com>
Ryan Hitchman <hitchmanr@gmail.com>
Ryan Lower <rpjlower@gmail.com>
Ryan Seys <ryan@ryanseys.com>
Ryan Slade <ryanslade@gmail.com>
Ryuzo Yamamoto <ryuzo.yamamoto@gmail.com>
S.Çağlar Onur <caglar@10ur.org>
Sakeven Jiang <jc5930@sina.cn>
Salmān Aljammāz <s@0x65.net>
Sam Boyer <tech@samboyer.org>
Sam Hug <samuel.b.hug@gmail.com>
Sam Whited <sam@samwhited.com>
Samuele Pedroni <pedronis@lucediurna.net>
Sanjay Menakuru <balasanjay@gmail.com>
Sascha Brawer <sascha@brawer.ch>
Sasha Sobol <sasha@scaledinference.com>
Scott Barron <scott.barron@github.com>
Scott Bell <scott@sctsm.com>
@@ -908,7 +758,6 @@ Sebastien Binet <seb.binet@gmail.com>
Sébastien Paolacci <sebastien.paolacci@gmail.com>
Sergei Skorobogatov <skorobo@rambler.ru>
Sergey 'SnakE' Gromov <snake.scaly@gmail.com>
Sergey Mishin <sergeymishine@gmail.com>
Sergio Luis O. B. Correia <sergio@correia.cc>
Seth Hoenig <seth.a.hoenig@gmail.com>
Seth Vargo <sethvargo@gmail.com>
@@ -918,7 +767,6 @@ Shaozhen Ding <dsz0111@gmail.com>
Shawn Smith <shawn.p.smith@gmail.com>
Shenghou Ma <minux.ma@gmail.com>
Shinji Tanaka <shinji.tanaka@gmail.com>
Shintaro Kaneko <kaneshin0120@gmail.com>
Shivakumar GN <shivakumar.gn@gmail.com>
Silvan Jegen <s.jegen@gmail.com>
Simon Jefford <simon.jefford@gmail.com>
@@ -938,17 +786,13 @@ Stan Schwertly <stan@schwertly.com>
Stefan Nilsson <snilsson@nada.kth.se> <trolleriprofessorn@gmail.com>
Stéphane Travostino <stephane.travostino@gmail.com>
Stephen McQuay <stephen@mcquay.me>
Stephen Searles <stephens2424@gmail.com>
Stephen Weinberg <stephen@q5comm.com>
Steve McCoy <mccoyst@gmail.com>
Steve Phillips <elimisteve@gmail.com>
Steve Streeting <steve@stevestreeting.com>
Steven Elliot Harris <seharris@gmail.com>
Steven Erenst <stevenerenst@gmail.com>
Steven Hartland <steven.hartland@multiplay.co.uk>
Steven Wilkin <stevenwilkin@gmail.com>
Stripe, Inc.
Sunny <me@darkowlzz.space>
Suyash <dextrous93@gmail.com>
Sven Almgren <sven@tras.se>
Syohei YOSHIDA <syohex@gmail.com>
@@ -962,14 +806,10 @@ Tamir Duberstein <tamird@gmail.com>
Tarmigan Casebolt <tarmigan@gmail.com>
Taru Karttunen <taruti@taruti.net>
Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
Ted Kornish <golang@tedkornish.com>
Teleport Inc.
Terrel Shumway <gopher@shumway.us>
Tetsuo Kiso <tetsuokiso9@gmail.com>
Thanatat Tamtan <acoshift@gmail.com>
Thiago Fransosi Farina <thiago.farina@gmail.com>
Thomas Alan Copeland <talan.copeland@gmail.com>
Thomas Bonfort <thomas.bonfort@gmail.com>
Thomas de Zeeuw <thomasdezeeuw@gmail.com>
Thomas Desrosiers <thomasdesr@gmail.com>
Thomas Kappler <tkappler@gmail.com>
@@ -983,23 +823,18 @@ Timo Savola <timo.savola@gmail.com>
Timo Truyts <alkaloid.btx@gmail.com>
Timothy Studd <tim@timstudd.com>
Tobias Columbus <tobias.columbus@gmail.com>
Tobias Klauser <tklauser@distanz.ch>
Todd Neal <todd@tneal.org>
Tom Heng <zhm20070928@gmail.com>
Tom Linford <tomlinford@gmail.com>
Tommy Schaefer <tommy.schaefer@teecom.com>
Tonis Tiigi <tonistiigi@gmail.com>
Tor Andersson <tor.andersson@gmail.com>
Tormod Erevik Lea <tormodlea@gmail.com>
Toshiki Shima <hayabusa1419@gmail.com>
Totoro W <tw19881113@gmail.com>
Travis Cline <travis.cline@gmail.com>
Trey Lawrence <lawrence.trey@gmail.com>
Trey Roessig <trey.roessig@gmail.com>
Trey Tacon <ttacon@gmail.com>
Tristan Colgate <tcolgate@gmail.com>
Tristan Ooohry <ooohry@gmail.com>
Trung Nguyen <trung.n.k@gmail.com>
Tudor Golubenco <tudor.g@gmail.com>
Tuo Shan <sturbo89@gmail.com>
Tyler Bunnell <tylerbunnell@gmail.com>
@@ -1012,7 +847,6 @@ Uriel Mangado <uriel@berlinblue.org>
Vadim Grek <vadimprog@gmail.com>
Vadim Vygonets <unixdj@gmail.com>
Vendasta
Victor Vrantchan <vrancean+github@gmail.com>
Vincent Ambo <tazjin@googlemail.com>
Vincent Batts <vbatts@hashbangbash.com> <vbatts@gmail.com>
Vincent Vanackere <vincent.vanackere@gmail.com>
@@ -1022,22 +856,15 @@ Vitor De Mario <vitordemario@gmail.com>
Vladimir Mihailenco <vladimir.webdev@gmail.com>
Vladimir Nikishenko <vova616@gmail.com>
Vladimir Stefanovic <vladimir.stefanovic@imgtec.com>
Vladimir Varankin <nek.narqo@gmail.com>
Volker Dobler <dr.volker.dobler@gmail.com>
Wade Simmons <wade@wades.im>
Wander Lairson Costa <wcosta@mozilla.com>
Weaveworks
Wei Guangjing <vcc.163@gmail.com>
Weichao Tang <tevic.tt@gmail.com>
Will Storey <will@summercat.com>
Willem van der Schyff <willemvds@gmail.com>
William Josephson <wjosephson@gmail.com>
William Orr <will@worrbase.com> <ay1244@gmail.com>
Wisdom Omuya <deafgoat@gmail.com>
Wu Yunzhou <yunzhouwu@gmail.com>
Xia Bin <snyh@snyh.org>
Xing Xing <mikespook@gmail.com>
Xu Fei <badgangkiller@gmail.com>
Xudong Zhang <felixmelon@gmail.com>
Xuyang Kang <xuyangkang@gmail.com>
Yahoo Inc.
@@ -1045,7 +872,6 @@ Yann Kerhervé <yann.kerherve@gmail.com>
Yao Zhang <lunaria21@gmail.com>
Yasuharu Goto <matope.ono@gmail.com>
Yasuhiro Matsumoto <mattn.jp@gmail.com>
Yestin Sun <ylh@pdx.edu>
Yesudeep Mangalapilly <yesudeep@google.com>
Yissakhar Z. Beck <yissakhar.beck@gmail.com>
Yo-An Lin <yoanlin93@gmail.com>
@@ -1056,15 +882,9 @@ Yusuke Kagiwada <block.rxckin.beats@gmail.com>
Yuusei Kuwana <kuwana@kumama.org>
Yuval Pavel Zholkover <paulzhol@gmail.com>
Zac Bergquist <zbergquist99@gmail.com>
Zach Bintliff <zbintliff@gmail.com>
Zak <zrjknill@gmail.com>
Zakatell Kanda <hi@zkanda.io>
Zellyn Hunter <zellyn@gmail.com>
Zemanta d.o.o.
Zev Goldstein <zev.goldstein@gmail.com>
Ziad Hatahet <hatahet@gmail.com>
Zorion Arrizabalaga <zorionk@gmail.com>
Максим Федосеев <max.faceless.frei@gmail.com>
Фахриддин Балтаев <faxriddinjon@gmail.com>
张嵩 <zs349596@gmail.com>
申习之 <bronze1man@gmail.com>

View File

@@ -4,18 +4,15 @@ Go is an open source project.
It is the work of hundreds of contributors. We appreciate your help!
## Before filing an issue
If you are unsure whether you have found a bug, please consider asking in the [golang-nuts mailing
list](https://groups.google.com/forum/#!forum/golang-nuts) or [other forums](https://golang.org/help/) first. If
the behavior you are seeing is confirmed as a bug or issue, it can easily be re-raised in the issue tracker.
## Filing issues
Sensitive security-related issues should be reported to [security@golang.org](mailto:security@golang.org).
See the [security policy](https://golang.org/security) for details.
General questions should go to the
[golang-nuts mailing list](https://groups.google.com/group/golang-nuts) or
[other forum](https://golang.org/wiki/Questions) instead of the issue tracker.
The gophers there will answer or ask you to file an issue if you've tripped over a bug.
Otherwise, when filing an issue, make sure to answer these five questions:
When filing an issue, make sure to answer these five questions:
1. What version of Go are you using (`go version`)?
2. What operating system and processor architecture are you using?
@@ -25,9 +22,12 @@ Otherwise, when filing an issue, make sure to answer these five questions:
For change proposals, see [Proposing Changes To Go](https://github.com/golang/proposal/).
Sensitive security-related issues should be reported to [security@golang.org](mailto:security@golang.org).
## Contributing code
Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) before sending patches.
Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html)
before sending patches.
**We do not accept GitHub pull requests**
(we use [an instance](https://go-review.googlesource.com/) of the

View File

@@ -40,20 +40,15 @@ Aaron Torres <tcboox@gmail.com>
Aaron Zinman <aaron@azinman.com>
Abe Haskins <abeisgreat@abeisgreat.com>
Abhinav Gupta <abhinav.g90@gmail.com>
Adam Bender <abender@google.com>
Adam Eijdenberg <adam@continusec.com>
Adam Langley <agl@golang.org>
Adrian Nos <nos.adrian@gmail.com>
Adrian O'Grady <elpollouk@gmail.com>
Adrien Bustany <adrien-xx-google@bustany.org>
Aécio Júnior <aeciodantasjunior@gmail.com>
Agis Anastasopoulos <agis.anast@gmail.com>
Ahmed Waheed Moanes <oneofone@gmail.com>
Ahmet Alp Balkan <ahmetb@google.com>
Ahmy Yulrizka <yulrizka@gmail.com>
Aiden Scandella <ai@uber.com>
Ainar Garipov <gugl.zadolbal@gmail.com>
Aishraj Dahal <aishraj@users.noreply.github.com>
Akihiro Suda <suda.kyoto@gmail.com>
Akshat Kumar <seed@mail.nanosouffle.net>
Alan Donovan <adonovan@google.com>
@@ -79,15 +74,11 @@ Alex Sergeyev <abc@alexsergeyev.com>
Alex Vaghin <crhyme@google.com>
Alexander Demakin <alexander.demakin@gmail.com>
Alexander Döring <email@alexd.ch>
Alexander Guz <kalimatas@gmail.com>
Alexander Kauer <alexander@affine.space>
Alexander Kucherenko <alxkchr@gmail.com>
Alexander Larsson <alexander.larsson@gmail.com>
Alexander Menzhinsky <amenzhinsky@gmail.com>
Alexander Morozov <lk4d4math@gmail.com>
Alexander Neumann <alexander@bumpern.de>
Alexander Orlov <alexander.orlov@loxal.net>
Alexander Polcyn <apolcyn@google.com>
Alexander Reece <awreece@gmail.com>
Alexander Surma <surma@surmair.de>
Alexander Zhavnerchik <alex.vizor@gmail.com>
@@ -98,10 +89,7 @@ Alexandre Normand <alexandre.normand@gmail.com>
Alexandru Moșoi <brtzsnr@gmail.com>
Alexei Sholik <alcosholik@gmail.com>
Alexey Borzenkov <snaury@gmail.com>
Alexey Neganov <neganovalexey@gmail.com>
Alexey Palazhchenko <alexey.palazhchenko@gmail.com>
Alexis Hildebrandt <surryhill@gmail.com>
Alexis Hunt <lexer@google.com>
Alexis Imperial-Legrand <ail@google.com>
Aliaksandr Valialkin <valyala@gmail.com>
Alif Rachmawadi <subosito@gmail.com>
@@ -109,7 +97,6 @@ Allan Simon <allan.simon@supinfo.com>
Alok Menghrajani <alok.menghrajani@gmail.com>
Amir Mohammad Saied <amir@gluegadget.com>
Amrut Joshi <amrut.joshi@gmail.com>
Anders Pearson <anders@columbia.edu>
Andre Nathan <andrenth@gmail.com>
Andrea Spadaccini <spadaccio@google.com>
Andreas Auernhammer <aead@mail.de>
@@ -120,14 +107,12 @@ Andrei Vieru <euvieru@gmail.com>
Andres Erbsen <andreser@google.com>
Andrew Austin <andrewaclt@gmail.com>
Andrew Balholm <andybalholm@gmail.com>
Andrew Benton <andrewmbenton@gmail.com>
Andrew Bonventre <andybons@chromium.org>
Andrew Bursavich <abursavich@gmail.com>
Andrew Ekstedt <andrew.ekstedt@gmail.com>
Andrew Etter <andrew.etter@gmail.com>
Andrew Gerrand <adg@golang.org>
Andrew Harding <andrew@spacemonkey.com>
Andrew Jackura <ajackura@google.com>
Andrew Lutomirski <andy@luto.us>
Andrew Pilloud <andrewpilloud@igneoussystems.com>
Andrew Pogrebnoy <absourd.noise@gmail.com>
@@ -154,12 +139,9 @@ Anthony Canino <anthony.canino1@gmail.com>
Anthony Eufemio <anthony.eufemio@gmail.com>
Anthony Martin <ality@pbrane.org>
Anthony Starks <ajstarks@gmail.com>
Anthony Voutas <voutasaurus@gmail.com>
Anthony Woods <awoods@raintank.io>
Antoine Martin <antoine97.martin@gmail.com>
Antonio Bibiano <antbbn@gmail.com>
Antonio Murdaca <runcom@redhat.com>
Antonio Troina <thoeni@gmail.com>
Apisak Darakananda <pongad@gmail.com>
Aram Hăvărneanu <aram@mgk.ro>
Areski Belaid <areski@gmail.com>
@@ -183,14 +165,12 @@ Ayanamist Yang <ayanamist@gmail.com>
Aymerick Jéhanne <aymerick@jehanne.org>
Baiju Muthukadan <baiju.m.mail@gmail.com>
Balazs Lecz <leczb@google.com>
Bartosz Grzybowski <melkorm@gmail.com>
Ben Burkert <ben@benburkert.com>
Ben Eitzen <eitzenb@golang.org>
Ben Fried <ben.fried@gmail.com>
Ben Lubar <ben.lubar@gmail.com>
Ben Lynn <benlynn@gmail.com>
Ben Olive <sionide21@gmail.com>
Ben Shi <powerman1st@163.com>
Benjamin Black <b@b3k.us>
Benjamin Prosnitz <bprosnitz@google.com>
Benjamin Wester <bwester@squareup.com>
@@ -199,7 +179,6 @@ Benoit Sigoure <tsunanet@gmail.com>
Berengar Lehr <Berengar.Lehr@gmx.de>
Bill Neubauer <wcn@golang.org> <wcn@google.com> <bill.neubauer@gmail.com>
Bill O'Farrell <billo@ca.ibm.com>
Bill Prin <waprin@google.com>
Bill Thiede <couchmoney@gmail.com>
Billie Harold Cleek <bhcleek@gmail.com>
Billy Lynch <wlynch@google.com>
@@ -212,12 +191,9 @@ Bobby Powers <bobbypowers@gmail.com>
Boris Nagaev <nagaev@google.com>
Brad Fitzpatrick <bradfitz@golang.org> <bradfitz@gmail.com>
Brad Garcia <bgarcia@golang.org>
Brad Jones <rbjones@google.com>
Brad Whitaker <bwhitaker@fastly.com>
Braden Bassingthwaite <bbassingthwaite@vendasta.com>
Brady Catherman <brady@gmail.com>
Brady Sullivan <brady@bsull.com>
Brandon Bennett <bbennett@fb.com>
Brandon Gilmore <varz@google.com>
Brendan Daniel Tracey <tracey.brendan@gmail.com>
Brendan O'Dea <bod@golang.org>
@@ -229,27 +205,21 @@ Brian Kennedy <btkennedy@gmail.com>
Brian Ketelsen <bketelsen@gmail.com>
Brian Slesinsky <skybrian@google.com>
Brian Smith <ohohvi@gmail.com>
Brian Starke <brian.starke@gmail.com>
Bryan Alexander <Kozical@msn.com>
Bryan C. Mills <bcmills@google.com>
Bryan Chan <bryan.chan@ca.ibm.com>
Bryan Ford <brynosaurus@gmail.com>
Bulat Gaifullin <gaifullinbf@gmail.com>
Caine Tighe <arctanofyourface@gmail.com>
Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Caleb Spare <cespare@gmail.com>
Carl Chatfield <carlchatfield@gmail.com>
Carl Henrik Lunde <chlunde@ifi.uio.no>
Carl Jackson <carl@stripe.com>
Carl Johnson <me@carlmjohnson.net>
Carl Mastrangelo <notcarl@google.com>
Carl Shapiro <cshapiro@google.com> <cshapiro@golang.org>
Carlisia Campos <carlisia@grokkingtech.io>
Carlo Alberto Ferraris <cafxx@strayorange.com>
Carlos Castillo <cookieo9@gmail.com>
Carlos Cirello <uldericofilho@gmail.com>
Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
Carolyn Van Slyck <me@carolynvanslyck.com>
Cary Hull <chull@google.com>
Case Nelson <case.nelson@gmail.com>
Casey Marshall <casey.marshall@gmail.com>
@@ -262,8 +232,6 @@ Charles L. Dorian <cldorian@gmail.com>
Charles Lee <zombie.fml@gmail.com>
Charles Weill <weill@google.com>
Cherry Zhang <cherryyz@google.com>
Chew Choon Keat <choonkeat@gmail.com>
Chris Biscardi <chris@christopherbiscardi.com>
Chris Broadfoot <cbro@golang.org>
Chris Dollin <ehog.hedge@gmail.com>
Chris Farmiloe <chrisfarms@gmail.com>
@@ -275,8 +243,6 @@ Chris Kastorff <encryptio@gmail.com>
Chris Lennert <calennert@gmail.com>
Chris Manghane <cmang@golang.org>
Chris McGee <sirnewton_01@yahoo.ca> <newton688@gmail.com>
Chris Raynor <raynor@google.com>
Chris Roche <rodaine@gmail.com>
Chris Stockton <chrisstocktonaz@gmail.com>
Chris Zou <chriszou@ca.ibm.com>
Christian Couder <chriscool@tuxfamily.org>
@@ -305,10 +271,7 @@ Cosmos Nicolaou <cnicolaou@google.com>
Cristian Staretu <unclejacksons@gmail.com>
Cuihtlauac ALVARADO <cuihtlauac.alvarado@orange.com>
Cyrill Schumacher <cyrill@schumacher.fm>
Daisuke Fujita <dtanshi45@gmail.com>
Daker Fernandes Pinheiro <daker.fernandes.pinheiro@intel.com>
Damian Gryski <dgryski@gmail.com>
Damien Lespiau <damien.lespiau@gmail.com> <damien.lespiau@intel.com>
Damien Neil <dneil@google.com>
Dan Caddigan <goldcaddy77@gmail.com>
Dan Callahan <dan.callahan@gmail.com>
@@ -329,7 +292,6 @@ Daniel Ortiz Pereira da Silva <daniel.particular@gmail.com>
Daniel Skinner <daniel@dasa.cc>
Daniel Speichert <daniel@speichert.pl>
Daniel Theophanes <kardianos@gmail.com>
Daniel Upton <daniel@floppy.co>
Daria Kolistratova <daria.kolistratova@intel.com>
Darren Elwood <darren@textnode.com>
Datong Sun <dndx@idndx.com>
@@ -338,7 +300,6 @@ Dave Bort <dbort@golang.org>
Dave Cheney <dave@cheney.net>
Dave Day <djd@golang.org>
Dave Grijalva <dgrijalva@ngmoco.com>
Dave MacFarlane <driusan@gmail.com>
David Anderson <danderson@google.com>
David Barnett <dbarnett@google.com>
David Benjamin <davidben@google.com>
@@ -358,7 +319,6 @@ David Jakob Fritz <david.jakob.fritz@gmail.com>
David Lazar <lazard@golang.org>
David Leon Gil <coruus@gmail.com>
David McLeish <davemc@google.com>
David NewHamlet <david@newhamlet.com>
David Presotto <presotto@gmail.com>
David R. Jenni <david.r.jenni@gmail.com>
David Sansome <me@davidsansome.com>
@@ -366,7 +326,6 @@ David Stainton <dstainton415@gmail.com>
David Symonds <dsymonds@golang.org>
David Thomas <davidthomas426@gmail.com>
David Titarenco <david.titarenco@gmail.com>
David Volquartz Lebech <david@lebech.info>
Davies Liu <davies.liu@gmail.com>
Dean Prichard <dean.prichard@gmail.com>
Deepak Jois <deepak.jois@gmail.com>
@@ -376,16 +335,13 @@ Denis Nagorny <denis.nagorny@intel.com>
Denys Honsiorovskyi <honsiorovskyi@gmail.com>
Derek Buitenhuis <derek.buitenhuis@gmail.com>
Derek Che <drc@yahoo-inc.com>
Derek McGowan <derek@mcgstyle.net>
Derek Parker <parkerderek86@gmail.com>
Derek Shockey <derek.shockey@gmail.com>
Devon H. O'Dell <devon.odell@gmail.com>
Dhaivat Pandit <dhaivatpandit@gmail.com>
Dhananjay Nakrani <dhananjayn@google.com>
Dhiru Kholia <dhiru.kholia@gmail.com>
Di Xiao <dixiao@google.com>
Didier Spezia <didier.06@gmail.com>
Dieter Plaetinck <dieter@raintank.io>
Dimitri Tcaciuc <dtcaciuc@gmail.com>
Dirk Gadsden <dirk@esherido.com>
Diwaker Gupta <diwakergupta@gmail.com>
@@ -397,13 +353,11 @@ Dmitriy Vyukov <dvyukov@google.com>
Dmitry Chestnykh <dchest@gmail.com>
Dmitry Savintsev <dsavints@gmail.com>
Dmitry Yakunin <nonamezeil@gmail.com>
Dominic Green <dominicgreen1@gmail.com>
Dominik Honnef <dominik.honnef@gmail.com>
Dominik Vogt <vogt@linux.vnet.ibm.com>
Donald Huang <don.hcd@gmail.com>
Donovan Hide <donovanhide@gmail.com>
Doug Anderson <douga@google.com>
Doug Fawley <dfawley@google.com>
Drew Hintz <adhintz@google.com>
Duncan Holm <mail@frou.org>
Dustin Carlino <dcarlino@google.com>
@@ -416,15 +370,12 @@ Eden Li <eden.li@gmail.com>
Edward Muller <edwardam@interlix.com>
Egon Elbre <egonelbre@gmail.com>
Ehren Kret <ehren.kret@gmail.com>
Eitan Adler <lists@eitanadler.com>
Eivind Uggedal <eivind@uggedal.com>
Elias Naur <elias.naur@gmail.com>
Elliot Morrison-Reed <elliotmr@gmail.com>
Emil Hessman <c.emil.hessman@gmail.com> <emil@hessman.se>
Emilien Kenler <hello@emilienkenler.com>
Emmanuel Odeke <emm.odeke@gmail.com> <odeke@ualberta.ca>
Eoghan Sherry <ejsherry@gmail.com>
Eric Chiang <eric.chiang.m@gmail.com>
Eric Clark <zerohp@gmail.com>
Eric Engestrom <eric@engestrom.ch>
Eric Garrido <ekg@google.com>
@@ -448,25 +399,17 @@ Evan Kroske <evankroske@google.com>
Evan Martin <evan.martin@gmail.com>
Evan Phoenix <evan@phx.io>
Evan Shaw <chickencha@gmail.com>
Evgeniy Polyakov <zbr@ioremap.net>
Ewan Chou <coocood@gmail.com>
Ewan Valentine <ewan.valentine89@gmail.com>
Eyal Posener <posener@gmail.com>
Fabian Wickborn <fabian@wickborn.net>
Fabian Zaremba <fabian@youremail.eu>
Fabrizio Milo <mistobaan@gmail.com>
Faiyaz Ahmed <ahmedf@vmware.com>
Fan Hongjian <fan.howard@gmail.com>
Fangming Fang <fangming.fang@arm.com>
Fatih Arslan <fatih@arslan.io>
Fazal Majid <majid@apsalar.com>
Fazlul Shahriar <fshahriar@gmail.com>
Federico Simoncelli <fsimonce@redhat.com>
Fedor Indutny <fedor@indutny.com>
Felipe Oliveira <felipeweb.programador@gmail.com>
Felix Geisendörfer <haimuiba@gmail.com>
Filip Gruszczyński <gruszczy@gmail.com>
Filippo Valsorda <filippo@cloudflare.com> <hi@filippo.io>
Filippo Valsorda <hi@filippo.io>
Firmansyah Adiputra <frm.adiputra@gmail.com>
Florian Uekermann <florian@uekermann-online.de> <f1@uekermann-online.de>
Florian Weimer <fw@deneb.enyo.de>
@@ -478,7 +421,6 @@ Francisco Claude <fclaude@recoded.cl>
Francisco Souza <franciscossouza@gmail.com>
Frederick Kelly Mayle III <frederickmayle@gmail.com>
Fredrik Enestad <fredrik.enestad@soundtrackyourbrand.com>
Fredrik Forsmo <fredrik.forsmo@gmail.com>
Frithjof Schulze <schulze@math.uni-hannover.de> <sfrithjof@gmail.com>
Frits van Bommel <fvbommel@gmail.com>
Fumitoshi Ukai <ukai@google.com>
@@ -492,10 +434,8 @@ Gary Elliott <garyelliott@google.com>
Gaurish Sharma <contact@gaurishsharma.com>
Gautham Thambidorai <gautham.dorai@gmail.com>
Geert-Johan Riemer <gjr19912@gmail.com>
Gengliang Wang <ltnwgl@gmail.com>
Geoffroy Lorieux <lorieux.g@gmail.com>
Georg Reinke <guelfey@gmail.com>
George Gkirtsou <ggirtsou@gmail.com>
George Shammas <george@shamm.as> <georgyo@gmail.com>
Gerasimos Dimitriadis <gedimitr@gmail.com>
Gideon Jan-Wessel Redelinghuys <gjredelinghuys@gmail.com>
@@ -509,11 +449,9 @@ Gordon Klaus <gordon.klaus@gmail.com>
Graham King <graham4king@gmail.com>
Graham Miller <graham.miller@gmail.com>
Greg Ward <greg@gerg.ca>
Gregory Man <man.gregory@gmail.com>
Guillaume J. Charmes <guillaume@charmes.net>
Guobiao Mei <meiguobiao@gmail.com>
Gustav Paul <gustav.paul@gmail.com>
Gustav Westling <gustav@westling.xyz>
Gustavo Franco <gustavorfranco@gmail.com>
Gustavo Niemeyer <gustavo@niemeyer.net> <n13m3y3r@gmail.com>
Gwenael Treguier <gwenn.kahz@gmail.com>
@@ -522,37 +460,29 @@ H. İbrahim Güngör <igungor@gmail.com>
Hajime Hoshi <hajimehoshi@gmail.com>
Hallgrimur Gunnarsson <halg@google.com>
Han-Wen Nienhuys <hanwen@google.com>
Hang Qian <hangqian90@gmail.com>
Hari haran <hariharan.uno@gmail.com>
Hariharan Srinath <srinathh@gmail.com>
Harley Laue <losinggeneration@gmail.com>
Harry Moreno <morenoh149@gmail.com>
Harshavardhana <hrshvardhana@gmail.com>
Hauke Löffler <hloeffler@users.noreply.github.com>
Håvard Haugen <havard.haugen@gmail.com>
Hector Chu <hectorchu@gmail.com>
Hector Martin Cantero <hector@marcansoft.com>
Henning Schmiedehausen <henning@schmiedehausen.org>
Henrik Edwards <henrik.edwards@gmail.com>
Henrik Hodne <henrik@hodne.io>
Henry Chang <mr.changyuheng@gmail.com>
Herbert Georg Fischer <herbert.fischer@gmail.com>
Heschi Kreinick <heschi@google.com>
Hironao OTSUBO <motemen@gmail.com>
Hiroshi Ioka <hirochachacha@gmail.com>
Hitoshi Mitake <mitake.hitoshi@gmail.com>
Holden Huang <ttyh061@gmail.com>
Hong Ruiqi <hongruiqi@gmail.com>
Hongfei Tan <feilengcui008@gmail.com>
Hossein Sheikh Attar <hattar@google.com>
Hsin Tsao <tsao@google.com>
Hsin-Ho Yeh <yhh92u@gmail.com>
Hu Keping <hukeping@huawei.com>
Hugues Bruant <hugues.bruant@gmail.com>
Hyang-Ah Hana Kim <hakim@google.com> <hyangah@gmail.com>
Ian Gudger <ian@loosescre.ws>
Ian Lance Taylor <iant@golang.org>
Ibrahim AshShohail <ibra.sho@gmail.com>
Icarus Sparry <golang@icarus.freeuk.com>
Idora Shinatose <idora.shinatose@gmail.com>
Igor Bernstein <igorbernstein@google.com>
@@ -579,56 +509,45 @@ James Aguilar <jaguilar@google.com>
James Bardin <j.bardin@gmail.com>
James Chacon <jchacon@google.com>
James Clarke <jrtc27@jrtc27.com>
James Cowgill <James.Cowgill@imgtec.com>
James David Chalfant <james.chalfant@gmail.com>
James Fysh <james.fysh@gmail.com>
James Gray <james@james4k.com>
James Hartig <fastest963@gmail.com>
James Meneghello <rawrz0r@gmail.com>
James Myers <jfmyers9@gmail.com>
James Neve <jamesoneve@gmail.com>
James P. Cooper <jamespcooper@gmail.com>
James Robinson <jamesr@google.com> <jamesr.gatech@gmail.com>
James Schofield <james@shoeboxapp.com>
James Smith <jrs1995@icloud.com>
James Sweet <james.sweet88@googlemail.com>
James Toy <nil@opensesame.st>
James Tucker <raggi@google.com>
James Whitehead <jnwhiteh@gmail.com>
Jamie Beverly <jamie.r.beverly@gmail.com>
Jamie Gennis <jgennis@google.com> <jgennis@gmail.com>
Jamie Stackhouse <contin673@gmail.com>
Jamie Turner <jamwt@dropbox.com>
Jamie Wilkinson <jaq@spacepants.org>
Jamil Djadala <djadala@gmail.com>
Jan Berktold <jan@berktold.co>
Jan H. Hosang <jan.hosang@gmail.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
Jan Mercl <0xjnml@gmail.com> <befelemepeseveze@gmail.com>
Jan Mercl <0xjnml@gmail.com>
Jan Mercl <befelemepeseveze@gmail.com>
Jan Newmarch <jan.newmarch@gmail.com>
Jan Ziak <0xe2.0x9a.0x9b@gmail.com>
Jani Monoses <jani.monoses@ubuntu.com> <jani.monoses@gmail.com>
Jaroslavas Počepko <jp@webmaster.ms>
Jason Barnett <jason.w.barnett@gmail.com>
Jason Buberel <jbuberel@google.com>
Jason Chu <jasonchujc@gmail.com>
Jason Del Ponte <delpontej@gmail.com>
Jason Hall <jasonhall@google.com>
Jason Smale <jsmale@zendesk.com>
Jason Travis <infomaniac7@gmail.com>
Jay Conrod <jayconrod@google.com>
Jay Weisskopf <jay@jayschwa.net>
Jean-Marc Eurin <jmeurin@google.com>
Jean-Nicolas Moal <jn.moal@gmail.com>
Jed Denlea <jed@fastly.com>
Jeff (Zhefu) Jiang <jeffjiang@google.com>
Jeff Craig <jeffcraig@google.com>
Jeff Hodges <jeff@somethingsimilar.com>
Jeff Johnson <jrjohnson@google.com>
Jeff R. Allen <jra@nella.org> <jeff.allen@gmail.com>
Jeff Sickel <jas@corpus-callosum.com>
Jeff Wendling <jeff@spacemonkey.com>
Jeffrey H <jeffreyh192@gmail.com>
Jens Frederich <jfrederich@gmail.com>
Jeremiah Harmsen <jeremiah@google.com>
Jeremy Jackins <jeremyjackins@gmail.com>
@@ -636,14 +555,11 @@ Jeremy Schlatter <jeremy.schlatter@gmail.com>
Jeroen Bobbeldijk <jerbob92@gmail.com>
Jess Frazelle <me@jessfraz.com>
Jesse Szwedko <jesse.szwedko@gmail.com>
Jianing Yu <jnyu@google.com>
Jianqiao Li <jianqiaoli@google.com>
Jihyun Yu <yjh0502@gmail.com>
Jim Cote <jfcote87@gmail.com>
Jim Kingdon <jim@bolt.me>
Jim McGrath <jimmc2@gmail.com>
Jimmy Zelinskie <jimmyzelinskie@gmail.com>
Jin-wook Jeong <jeweljar@hanmail.net>
Jingcheng Zhang <diogin@gmail.com>
Jingguo Yao <yaojingguo@gmail.com>
Jiong Du <londevil@gmail.com>
@@ -653,14 +569,11 @@ Joe Farrell <joe2farrell@gmail.com>
Joe Harrison <joehazzers@gmail.com>
Joe Henke <joed.henke@gmail.com>
Joe Poirier <jdpoirier@gmail.com>
Joe Richey joerichey@google.com <joerichey@google.com>
Joe Shaw <joe@joeshaw.org>
Joe Sylve <joe.sylve@gmail.com>
Joe Tsai <joetsai@digital-static.net>
Joel Sing <jsing@google.com>
Joël Stemmer <jstemmer@google.com>
Joel Stemmer <stemmertech@gmail.com>
Johan Brandhorst <johan.brandhorst@gmail.com>
Johan Euphrosine <proppy@google.com>
Johan Sageryd <j@1616.se>
John Asmuth <jasmuth@gmail.com>
@@ -688,12 +601,10 @@ Jonathan Mark <jhmark@xenops.com> <jhmark000@gmail.com>
Jonathan Nieder <jrn@google.com>
Jonathan Pittman <jmpittman@google.com> <jonathan.mark.pittman@gmail.com>
Jonathan Rudenberg <jonathan@titanous.com>
Jonathan Stacks <jonstacks13@gmail.com>
Jonathan Wills <runningwild@gmail.com>
Jongmin Kim <atomaths@gmail.com>
Joonas Kuorilehto <joneskoo@derbian.fi>
Joop Kiefte <ikojba@gmail.com> <joop@kiefte.net>
Jordan Krage <jmank88@gmail.com>
Jordan Lewis <jordanthelewis@gmail.com>
Jos Visser <josv@google.com>
Jose Luis Vázquez González <josvazg@gmail.com>
@@ -701,38 +612,29 @@ Joseph Bonneau <jcb@google.com>
Joseph Holsten <joseph@josephholsten.com>
Josh Bleecher Snyder <josharian@gmail.com>
Josh Chorlton <jchorlton@gmail.com>
Josh Deprez <josh.deprez@gmail.com>
Josh Goebel <dreamer3@gmail.com>
Josh Hoak <jhoak@google.com>
Josh Holland <jrh@joshh.co.uk>
Joshua Boelter <joshua.boelter@intel.com>
Joshua Chase <jcjoshuachase@gmail.com>
Josselin Costanzi <josselin@costanzi.fr>
Jostein Stuhaug <js@solidsystem.no>
JP Sugarbroad <jpsugar@google.com>
JT Olds <jtolds@xnet5.com>
Jukka-Pekka Kekkonen <karatepekka@gmail.com>
Julia Hansbrough <flowerhack@google.com>
Julian Kornberger <jk+github@digineo.de>
Julian Pastarmov <pastarmovj@google.com>
Julian Phillips <julian@quantumfyre.co.uk>
Julien Schmidt <google@julienschmidt.com>
Julio Montes <julio.montes@intel.com>
Jungho Ahn <jhahn@google.com>
Jure Ham <jure.ham@zemanta.com>
Justin Nuß <nuss.justin@gmail.com>
Justyn Temme <justyntemme@gmail.com>
Kai Backman <kaib@golang.org>
Kai Trukenmüller <ktye78@gmail.com>
Kale Blankenship <kale@lemnisys.com>
Kaleb Elwert <kelwert@atlassian.com>
Kamal Aboul-Hosn <aboulhosn@google.com>
Kamil Chmielewski <kamil.chm@gmail.com>
Kamil Kisiel <kamil@kamilkisiel.net> <kamil.kisiel@gmail.com>
Kang Hu <hukangustc@gmail.com>
Karan Dhiman <karandhi@ca.ibm.com>
Karoly Negyesi <chx1975@gmail.com>
Kashav Madan <kshvmdn@gmail.com>
Kato Kazuyoshi <kato.kazuyoshi@gmail.com>
Katrina Owen <katrina.owen@gmail.com>
Kaviraj Kanagaraj <kavirajkanagaraj@gmail.com>
@@ -740,7 +642,6 @@ Kay Zhu <kayzhu@google.com>
KB Sriram <kbsriram@google.com>
Keegan Carruthers-Smith <keegan.csmith@gmail.com>
Kei Son <hey.calmdown@gmail.com>
Keiji Yoshida <keijiyoshida.mail@gmail.com>
Keith Ball <inflatablewoman@gmail.com>
Keith Randall <khr@golang.org>
Keith Rarick <kr@xph.us>
@@ -760,58 +661,37 @@ Kevin Klues <klueska@gmail.com> <klueska@google.com>
Kevin Malachowski <chowski@google.com>
Kevin Vu <kevin.m.vu@gmail.com>
Kim Shrier <kshrier@racktopsystems.com>
Kim Yongbin <kybinz@gmail.com>
Kirill Smelkov <kirr@nexedi.com>
Kirklin McDonald <kirklin.mcdonald@gmail.com>
Klaus Post <klauspost@gmail.com>
Kodie Goodwin <kodiegoodwin@gmail.com>
Koichi Shiraishi <zchee.io@gmail.com>
Koki Ide <niconegoto@yahoo.co.jp>
Konstantin <konstantin8105@gmail.com>
Konstantin Shaposhnikov <k.shaposhnikov@gmail.com>
Kris Nova <kris@nivenly.com>
Kris Rousey <krousey@google.com>
Kristopher Watts <traetox@gmail.com>
Kun Li <likunarmstrong@gmail.com>
Kyle Consalus <consalus@gmail.com>
Kyle Isom <kyle@gokyle.net>
Kyle Jones <kyle@kyledj.com>
Kyle Lemons <kyle@kylelemons.net> <kevlar@google.com>
Kyrylo Silin <silin@kyrylo.org>
L Campbell <unpantsu@gmail.com>
Lai Jiangshan <eag0628@gmail.com>
Larry Hosken <lahosken@golang.org>
Lars Jeppesen <jeppesen.lars@gmail.com>
Lars Wiegman <lars@namsral.com>
Larz Conwell <larzconwell@gmail.com>
Laurie Clark-Michalek <laurie@qubit.com>
LE Manh Cuong <cuong.manhle.vn@gmail.com>
Lee Hinman <hinman@gmail.com>
Lee Packham <lpackham@gmail.com>
Leon Klingele <git@leonklingele.de>
Lev Shamardin <shamardin@gmail.com>
Lewin Bormann <lewin.bormann@gmail.com>
Lion Yang <lion@aosc.xyz>
Lloyd Dewolf <foolswisdom@gmail.com>
Lorenzo Masini <rugginoso@develer.com>
Lorenzo Stoakes <lstoakes@gmail.com>
Louis Kruger <louisk@google.com>
Luan Santos <cfcluan@gmail.com>
Luca Greco <luca.greco@alcacoop.it>
Lucas Bremgartner <lucas.bremgartner@gmail.com>
Lucas Clemente <lclemente@google.com>
Lucien Stuker <lucien.stuker@gmail.com>
Lucio De Re <lucio.dere@gmail.com>
Ludi Rehak <ludi317@gmail.com>
Luigi Riefolo <luigi.riefolo@gmail.com>
Luit van Drongelen <luitvd@gmail.com>
Luka Zakrajšek <tr00.g33k@gmail.com>
Lukasz Milewski <lmmilewski@gmail.com>
Luke Curley <qpingu@gmail.com>
Luna Duclos <luna.duclos@palmstonegames.com>
Luuk van Dijk <lvd@golang.org> <lvd@google.com>
Lynn Boger <laboger@linux.vnet.ibm.com>
Magnus Hiie <magnus.hiie@gmail.com>
Maksym Trykur <maksym.trykur@gmail.com>
Mal Curtis <mal@mal.co.nz>
Manfred Touron <m@42.am>
@@ -823,62 +703,43 @@ Marc Weistroff <marc@weistroff.net>
Marc-Antoine Ruel <maruel@chromium.org>
Marcel Edmund Franke <marcel.edmund.franke@gmail.com>
Marcel van Lohuizen <mpvl@golang.org>
Marcelo E. Magallon <marcelo.magallon@gmail.com>
Marco Hennings <marco.hennings@freiheit.com>
Marga Manterola <marga@google.com>
Marin Bašić <marin.basic02@gmail.com>
Marius Nuennerich <mnu@google.com>
Mark Adams <mark@markadams.me>
Mark Bucciarelli <mkbucc@gmail.com>
Mark Harrison <marhar@google.com>
Mark Ryan <mark.d.ryan@intel.com>
Mark Severson <miquella@gmail.com>
Mark Theunissen <mark.theunissen@gmail.com>
Mark Zavislak <zavislak@google.com>
Marko Juhani Silokunnas <marko.silokunnas@gmail.com>
Marko Mikulicic <mkm@google.com>
Marko Mudrinic <mudrinic.mare@gmail.com>
Marko Tiikkaja <marko@joh.to>
Markus Duft <markus.duft@salomon.at>
Markus Sonderegger <marraison@gmail.com>
Markus Zimmermann <zimmski@gmail.com>
Martin Bertschler <mbertschler@gmail.com>
Martin Garton <garton@gmail.com>
Martin Habbecke <marhab@google.com>
Martin Hamrle <martin.hamrle@gmail.com>
Martin Hoefling <martin.hoefling@gmx.de>
Martin Kreichgauer <martinkr@google.com>
Martin Lindhe <martin.j.lindhe@gmail.com>
Martin Möhrmann <moehrmann@google.com> <martisch@uos.de>
Martin Neubauer <m.ne@gmx.net>
Martin Olsen <github.com@martinolsen.net>
Martin Olsson <martin@minimum.se>
Martin Probst <martin@probst.io>
Marvin Stenger <marvin.stenger94@gmail.com>
Marwan Sulaiman <marwan.sulaiman@work.co>
Masahiro Furudate <masahiro.furudate@gmail.com>
Masahiro Wakame <vvakame@gmail.com>
Masaki Yoshida <yoshida.masaki@gmail.com>
Máté Gulyás <mgulyas86@gmail.com>
Mateusz Czapliński <czapkofan@gmail.com>
Mathias Beke <git@denbeke.be>
Mathias Hall-Andersen <mathias@hall-andersen.dk>
Mathias Leppich <mleppich@muhqu.de>
Mathieu Lonjaret <mathieu.lonjaret@gmail.com>
Mats Lidell <mats.lidell@cag.se> <mats.lidell@gmail.com>
Matt Aimonetti <mattaimonetti@gmail.com>
Matt Blair <me@matthewblair.net>
Matt Bostock <matt@mattbostock.com>
Matt Brown <mdbrown@google.com>
Matt Drollette <matt@drollette.com>
Matt Harden <matt.harden@gmail.com>
Matt Jibson <matt.jibson@gmail.com>
Matt Joiner <anacrolix@gmail.com>
Matt Jones <mrjones@google.com>
Matt Layher <mdlayher@gmail.com>
Matt Reiferson <mreiferson@gmail.com>
Matt Robenolt <matt@ydekproductions.com>
Matt Strong <mstrong1341@gmail.com>
Matt T. Proud <matt.proud@gmail.com>
Matt Williams <gh@mattyw.net> <mattyjwilliams@gmail.com>
Matthew Brennan <matty.brennan@gmail.com>
@@ -893,8 +754,6 @@ Max Riveiro <kavu13@gmail.com>
Maxim Khitrov <max@mxcrypt.com>
Maxim Pimenov <mpimenov@google.com>
Maxim Ushakov <ushakov@google.com>
Maxime de Roucy <maxime.deroucy@gmail.com>
Máximo Cuadros Ortiz <mcuadros@gmail.com>
Maxwell Krohn <themax@gmail.com>
Meir Fischer <meirfischer@gmail.com>
Meng Zhuo <mengzhuo1203@gmail.com>
@@ -932,7 +791,6 @@ Michalis Kargakis <michaliskargakis@gmail.com>
Michel Lespinasse <walken@google.com>
Miek Gieben <miek@miek.nl> <remigius.gieben@gmail.com>
Miguel Mendez <stxmendez@gmail.com>
Miguel Molina <hi@mvader.me>
Mihai Borobocea <MihaiBorobocea@gmail.com>
Mikael Tillenius <mikti42@gmail.com>
Mike Andrews <mra@xoba.com>
@@ -943,56 +801,42 @@ Mike Rosset <mike.rosset@gmail.com>
Mike Samuel <mikesamuel@gmail.com>
Mike Solomon <msolo@gmail.com>
Mike Strosaker <strosake@us.ibm.com>
Mike Wiacek <mjwiacek@google.com>
Mikhail Gusarov <dottedmag@dottedmag.net>
Mikhail Panchenko <m@mihasya.com>
Miki Tebeka <miki.tebeka@gmail.com>
Mikio Hara <mikioh.mikioh@gmail.com>
Mikkel Krautz <mikkel@krautz.dk> <krautz@gmail.com>
Milutin Jovanović <jovanovic.milutin@gmail.com>
Miquel Sabaté Solà <mikisabate@gmail.com>
Miroslav Genov <mgenov@gmail.com>
Mohit Agarwal <mohit@sdf.org>
Momchil Velikov <momchil.velikov@gmail.com>
Monis Khan <mkhan@redhat.com>
Monty Taylor <mordred@inaugust.com>
Moriyoshi Koizumi <mozo@mozo.jp>
Morten Siebuhr <sbhr@sbhr.dk>
Môshe van der Sterre <moshevds@gmail.com>
Mostyn Bramley-Moore <mostyn@antipode.se>
Mrunal Patel <mrunalp@gmail.com>
Muhammed Uluyol <uluyol0@gmail.com>
Mura Li <mura_li@castech.com.tw>
Nan Deng <monnand@gmail.com>
Nathan Caza <mastercactapus@gmail.com>
Nathan Humphreys <nkhumphreys@gmail.com>
Nathan John Youngman <nj@nathany.com>
Nathan Otterness <otternes@cs.unc.edu>
Nathan P Finch <nate.finch@gmail.com>
Nathan VanBenschoten <nvanbenschoten@gmail.com>
Nathan Youngman <git@nathany.com>
Nathan(yinian) Hu <nathanhu@google.com>
Nathaniel Cook <nvcook42@gmail.com>
Neelesh Chandola <neelesh.c98@gmail.com>
Neil Lyons <nwjlyons@googlemail.com>
Neuman Vong <neuman.vong@gmail.com>
Nevins Bartolomeo <nevins.bartolomeo@gmail.com>
Niall Sheridan <nsheridan@gmail.com>
Nic Day <nic.day@me.com>
Nicholas Katsaros <nick@nickkatsaros.com>
Nicholas Maniscalco <nicholas@maniscalco.com>
Nicholas Presta <nick@nickpresta.ca> <nick1presta@gmail.com>
Nicholas Sullivan <nicholas.sullivan@gmail.com>
Nicholas Waples <nwaples@gmail.com>
Nick Cooper <nmvc@google.com>
Nick Craig-Wood <nick@craig-wood.com> <nickcw@gmail.com>
Nick Harper <nharper@google.com>
Nick Kubala <nkubala@google.com>
Nick Leli <nicholasleli@gmail.com>
Nick Miyake <nmiyake@users.noreply.github.com>
Nick Patavalis <nick.patavalis@gmail.com>
Nick Petroni <npetroni@cs.umd.edu>
Nick Robinson <nrobinson13@gmail.com>
Nicolas Kaiser <nikai@nikai.net>
Nicolas Owens <mischief@offblast.org>
Nicolas S. Dade <nic.dade@gmail.com>
@@ -1000,27 +844,22 @@ Niels Widger <niels.widger@gmail.com>
Nigel Kerr <nigel.kerr@gmail.com>
Nigel Tao <nigeltao@golang.org>
Nik Nyby <nnyby@columbia.edu>
Niklas Schnelle <niklas.schnelle@gmail.com>
Niko Dziemba <niko@dziemba.com>
Nikolay Turpitko <nikolay@turpitko.com>
Niranjan Godbole <niranjan8192@gmail.com>
Noah Campbell <noahcampbell@gmail.com>
Nodir Turakulov <nodir@google.com>
Norberto Lopes <nlopes.ml@gmail.com>
Odin Ugedal <odin@ugedal.com>
Oleg Bulatov <dmage@yandex-team.ru>
Oleg Vakheta <helginet@gmail.com>
Oleku Konko <oleku.konko@gmail.com>
Oling Cat <olingcat@gmail.com>
Oliver Hookins <ohookins@gmail.com>
Oliver Tonnhofer <olt@bogosoft.com>
Olivier Antoine <olivier.antoine@gmail.com>
Olivier Duperray <duperray.olivier@gmail.com>
Olivier Poitrey <rs@dailymotion.com>
Olivier Saingre <osaingre@gmail.com>
Omar Jarjur <ojarjur@google.com>
Özgür Kesim <oec-go@kesim.org>
Pablo Lalloni <plalloni@gmail.com>
Padraig Kitterick <padraigkitterick@gmail.com>
Paolo Giarrusso <p.giarrusso@gmail.com>
Paolo Martini <mrtnpaolo@gmail.com>
@@ -1032,7 +871,6 @@ Patrick Higgins <patrick.allen.higgins@gmail.com>
Patrick Lee <pattyshack101@gmail.com>
Patrick Mézard <patrick@mezard.eu>
Patrick Mylund Nielsen <patrick@patrickmn.com>
Patrick Pelletier <pp.pelletier@gmail.com>
Patrick Riley <pfr@google.com>
Patrick Smith <pat42smith@gmail.com>
Paul A Querna <paul.querna@gmail.com>
@@ -1040,38 +878,31 @@ Paul Borman <borman@google.com>
Paul Chang <paulchang@google.com>
Paul Hammond <paul@paulhammond.org>
Paul Hankin <paulhankin@google.com>
Paul Jolly <paul@myitcv.org.uk>
Paul Lalonde <paul.a.lalonde@gmail.com>
Paul Marks <pmarks@google.com>
Paul Meyer <paul.meyer@microsoft.com>
Paul Nasrat <pnasrat@google.com>
Paul Querna <pquerna@apache.org>
Paul Rosania <paul.rosania@gmail.com>
Paul Sbarra <Sbarra.Paul@gmail.com>
Paul Smith <paulsmith@pobox.com> <paulsmith@gmail.com>
Paul van Brouwershaven <paul@vanbrouwershaven.com>
Paul Wankadia <junyer@google.com>
Paulo Casaretto <pcasaretto@gmail.com>
Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com>
Pavel Paulau <pavel.paulau@gmail.com>
Pavel Zinovkin <pavel.zinovkin@gmail.com>
Pavlo Sumkin <ymkins@gmail.com>
Pawel Knap <pawelknap88@gmail.com>
Pawel Szczur <filemon@google.com>
Percy Wegmann <ox.to.a.cart@gmail.com>
Perry Abbott <perry.j.abbott@gmail.com>
Petar Maymounkov <petarm@gmail.com>
Peter Armitage <peter.armitage@gmail.com>
Peter Bourgon <peter@bourgon.org>
Peter Collingbourne <pcc@google.com>
Peter Froehlich <peter.hans.froehlich@gmail.com>
Peter Gonda <pgonda@google.com>
Peter Kleiweg <pkleiweg@xs4all.nl>
Peter McKenzie <petermck@google.com>
Peter Moody <pmoody@uber.com>
Peter Morjan <pmorjan@gmail.com>
Peter Mundy <go.peter.90@gmail.com>
Peter Nguyen <peter@mictis.com>
Péter Surányi <speter.go1@gmail.com>
Péter Szabó <pts@google.com>
Péter Szilágyi <peterke@gmail.com>
@@ -1086,18 +917,14 @@ Philip Hofer <phofer@umich.edu>
Philip K. Warren <pkwarren@gmail.com>
Pierre Durand <pierredurand@gmail.com>
Pierre Roullon <pierre.roullon@gmail.com>
Piers <google@hellopiers.pro>
Pieter Droogendijk <pieter@binky.org.uk>
Pietro Gagliardi <pietro10@mac.com>
Prasanna Swaminathan <prasanna@mediamath.com>
Prashant Varanasi <prashant@prashantv.com>
Pravendra Singh <hackpravj@gmail.com>
Preetam Jinka <pj@preet.am>
Qiuxuan Zhu <ilsh1022@gmail.com>
Quan Tran <qeed.quan@gmail.com>
Quan Yong Zhai <qyzhai@gmail.com>
Quentin Perez <qperez@ocs.online.net>
Quentin Renard <contact@asticode.com>
Quentin Smith <quentin@golang.org>
Quinn Slack <sqs@sourcegraph.com>
Quoc-Viet Nguyen <afelion@gmail.com>
@@ -1111,29 +938,23 @@ Ramesh Dharan <dharan@google.com>
Raph Levien <raph@google.com>
Raphael Geronimi <raphael.geronimi@gmail.com>
Raul Silvera <rsilvera@google.com>
Ray Tung <rtung@thoughtworks.com>
Raymond Kazlauskas <raima220@gmail.com>
Rebecca Stambler <rstambler@golang.org>
Reinaldo de Souza Jr <juniorz@gmail.com>
Remi Gillig <remigillig@gmail.com>
Rémy Oudompheng <oudomphe@phare.normalesup.org> <remyoudompheng@gmail.com>
Rhys Hiltner <rhys@justin.tv>
Ricardo Padilha <ricardospadilha@gmail.com>
Richard Barnes <rlb@ipv.sx>
Richard Crowley <r@rcrowley.org>
Richard Dingwall <rdingwall@gmail.com>
Richard Eric Gavaletz <gavaletz@gmail.com>
Richard Gibson <richard.gibson@gmail.com>
Richard Miller <miller.research@gmail.com>
Richard Musiol <mail@richard-musiol.de> <neelance@gmail.com>
Rick Arnold <rickarnoldjr@gmail.com>
Rick Hudson <rlh@golang.org>
Rick Sayre <whorfin@gmail.com>
Riku Voipio <riku.voipio@linaro.org>
Risto Jaakko Saarelma <rsaarelm@gmail.com>
Rob Earhart <earhart@google.com>
Rob Norman <rob.norman@infinitycloud.com>
Rob Phoenix <rob@robphoenix.com>
Rob Pike <r@golang.org>
Robert Daniel Kortschak <dan.kortschak@adelaide.edu.au>
Robert Dinu <r@varp.se>
@@ -1160,7 +981,6 @@ Russ Cox <rsc@golang.org>
Russell Haering <russellhaering@gmail.com>
Ryan Bagwell <ryanbagwell@outlook.com>
Ryan Barrett <ryanb@google.com>
Ryan Boehning <ryan.boehning@apcera.com>
Ryan Brown <ribrdb@google.com>
Ryan Hitchman <hitchmanr@gmail.com>
Ryan Lower <rpjlower@gmail.com>
@@ -1169,9 +989,7 @@ Ryan Slade <ryanslade@gmail.com>
Ryuzo Yamamoto <ryuzo.yamamoto@gmail.com>
S.Çağlar Onur <caglar@10ur.org>
Sai Cheemalapati <saicheems@google.com>
Sakeven Jiang <jc5930@sina.cn>
Salmān Aljammāz <s@0x65.net>
Sam Boyer <tech@samboyer.org>
Sam Ding <samding@ca.ibm.com>
Sam Hug <samuel.b.hug@gmail.com>
Sam Thorogood <thorogood@google.com> <sam.thorogood@gmail.com>
@@ -1182,7 +1000,6 @@ Samuel Tan <samueltan@google.com>
Samuele Pedroni <pedronis@lucediurna.net>
Sanjay Menakuru <balasanjay@gmail.com>
Sarah Adams <shadams@google.com>
Sascha Brawer <sascha@brawer.ch>
Sasha Lionheart <lionhearts@google.com>
Sasha Sobol <sasha@scaledinference.com>
Scott Barron <scott.barron@github.com>
@@ -1193,8 +1010,6 @@ Scott Mansfield <smansfield@netflix.com>
Scott Schwartz <scotts@golang.org>
Scott Van Woudenberg <scottvw@google.com>
Sean Burford <sburford@google.com>
Sean Chittenden <seanc@joyent.com>
Sean Christopherson <sean.j.christopherson@intel.com>
Sean Dolphin <Sean.Dolphin@kpcompass.com>
Sean Harger <sharger@google.com>
Sean Rees <sean@erifax.org>
@@ -1203,7 +1018,6 @@ Sébastien Paolacci <sebastien.paolacci@gmail.com>
Sergei Skorobogatov <skorobo@rambler.ru>
Sergey 'SnakE' Gromov <snake.scaly@gmail.com>
Sergey Arseev <sergey.arseev@intel.com>
Sergey Mishin <sergeymishine@gmail.com>
Sergio Luis O. B. Correia <sergio@correia.cc>
Seth Hoenig <seth.a.hoenig@gmail.com>
Seth Vargo <sethvargo@gmail.com>
@@ -1215,7 +1029,6 @@ Shawn Smith <shawn.p.smith@gmail.com>
Shawn Walker-Salas <shawn.walker@oracle.com>
Shenghou Ma <minux@golang.org> <minux.ma@gmail.com>
Shinji Tanaka <shinji.tanaka@gmail.com>
Shintaro Kaneko <kaneshin0120@gmail.com>
Shivakumar GN <shivakumar.gn@gmail.com>
Shun Fan <sfan@google.com>
Silvan Jegen <s.jegen@gmail.com>
@@ -1227,7 +1040,6 @@ Sina Siadat <siadat@gmail.com>
Sokolov Yura <funny.falcon@gmail.com>
Song Gao <song@gao.io>
Spencer Nelson <s@spenczar.com>
Spencer Tung <spencertung@google.com>
Spring Mc <heresy.mc@gmail.com>
Srdjan Petrovic <spetrovic@google.com>
Sridhar Venkatakrishnan <sridhar@laddoo.net>
@@ -1237,7 +1049,6 @@ Stefan Nilsson <snilsson@nada.kth.se> <trolleriprofessorn@gmail.com>
Stéphane Travostino <stephane.travostino@gmail.com>
Stephen Ma <stephenm@golang.org>
Stephen McQuay <stephen@mcquay.me>
Stephen Searles <stephens2424@gmail.com>
Stephen Weinberg <stephen@q5comm.com>
Steve Francia <spf@golang.org>
Steve McCoy <mccoyst@gmail.com>
@@ -1245,12 +1056,9 @@ Steve Newman <snewman@google.com>
Steve Phillips <elimisteve@gmail.com>
Steve Streeting <steve@stevestreeting.com>
Steven Elliot Harris <seharris@gmail.com>
Steven Erenst <stevenerenst@gmail.com>
Steven Hartland <steven.hartland@multiplay.co.uk>
Steven Wilkin <stevenwilkin@gmail.com>
Sugu Sougoumarane <ssougou@gmail.com>
Suharsh Sivakumar <suharshs@google.com>
Sunny <me@darkowlzz.space>
Suyash <dextrous93@gmail.com>
Sven Almgren <sven@tras.se>
Sven Blumenstein <svbl@google.com>
@@ -1260,22 +1068,17 @@ Tad Glines <tad.glines@gmail.com>
Taj Khattra <taj.khattra@gmail.com>
Takashi Matsuo <tmatsuo@google.com>
Takeshi YAMANASHI <9.nashi@gmail.com>
Takuto Ikuta <tikuta@google.com>
Takuya Ueda <uedatakuya@gmail.com>
Tal Shprecher <tshprecher@gmail.com>
Tamir Duberstein <tamird@gmail.com>
Tarmigan Casebolt <tarmigan@gmail.com>
Taru Karttunen <taruti@taruti.net>
Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
Ted Kornish <golang@tedkornish.com>
Terrel Shumway <gopher@shumway.us>
Tetsuo Kiso <tetsuokiso9@gmail.com>
Than McIntosh <thanm@google.com>
Thanatat Tamtan <acoshift@gmail.com>
Thiago Fransosi Farina <thiago.farina@gmail.com> <tfarina@chromium.org>
Thomas Alan Copeland <talan.copeland@gmail.com>
Thomas Bonfort <thomas.bonfort@gmail.com>
Thomas Bouldin <inlined@google.com>
Thomas de Zeeuw <thomasdezeeuw@gmail.com>
Thomas Desrosiers <thomasdesr@gmail.com>
Thomas Habets <habets@google.com>
@@ -1293,7 +1096,6 @@ Timo Truyts <alkaloid.btx@gmail.com>
Timothy Studd <tim@timstudd.com>
Tipp Moseley <tipp@google.com>
Tobias Columbus <tobias.columbus@gmail.com> <tobias.columbus@googlemail.com>
Tobias Klauser <tklauser@distanz.ch>
Toby Burress <kurin@google.com>
Todd Neal <todd@tneal.org>
Todd Wang <toddwang@gmail.com>
@@ -1303,20 +1105,16 @@ Tom Linford <tomlinford@gmail.com>
Tom Szymanski <tgs@google.com>
Tom Wilkie <tom@weave.works>
Tommy Schaefer <tommy.schaefer@teecom.com>
Tonis Tiigi <tonistiigi@gmail.com>
Tor Andersson <tor.andersson@gmail.com>
Tormod Erevik Lea <tormodlea@gmail.com>
Toshiki Shima <hayabusa1419@gmail.com>
Totoro W <tw19881113@gmail.com>
Travis Cline <travis.cline@gmail.com>
Trevor Strohman <trevor.strohman@gmail.com>
Trey Lawrence <lawrence.trey@gmail.com>
Trey Roessig <trey.roessig@gmail.com>
Trey Tacon <ttacon@gmail.com>
Tristan Amini <tamini01@ca.ibm.com>
Tristan Colgate <tcolgate@gmail.com>
Tristan Ooohry <ooohry@gmail.com>
Trung Nguyen <trung.n.k@gmail.com>
Tudor Golubenco <tudor.g@gmail.com>
Tuo Shan <sturbo89@gmail.com> <shantuo@google.com>
Tyler Bunnell <tylerbunnell@gmail.com>
@@ -1331,8 +1129,6 @@ Vadim Grek <vadimprog@gmail.com>
Vadim Vygonets <unixdj@gmail.com>
Vega Garcia Luis Alfonso <vegacom@gmail.com>
Victor Chudnovsky <vchudnov@google.com>
Victor Vrantchan <vrancean+github@gmail.com>
Vikas Kedia <vikask@google.com>
Vincent Ambo <tazjin@googlemail.com>
Vincent Batts <vbatts@hashbangbash.com> <vbatts@gmail.com>
Vincent Vanackere <vincent.vanackere@gmail.com>
@@ -1344,28 +1140,20 @@ Vlad Krasnov <vlad@cloudflare.com>
Vladimir Mihailenco <vladimir.webdev@gmail.com>
Vladimir Nikishenko <vova616@gmail.com>
Vladimir Stefanovic <vladimir.stefanovic@imgtec.com>
Vladimir Varankin <nek.narqo@gmail.com>
Volker Dobler <dr.volker.dobler@gmail.com>
Volodymyr Paprotski <vpaprots@ca.ibm.com>
Wade Simmons <wade@wades.im>
Walter Poupore <wpoupore@google.com>
Wander Lairson Costa <wcosta@mozilla.com>
Wedson Almeida Filho <wedsonaf@google.com>
Wei Guangjing <vcc.163@gmail.com>
Wei Xiao <wei.xiao@arm.com>
Weichao Tang <tevic.tt@gmail.com>
Will Chan <willchan@google.com>
Will Norris <willnorris@google.com>
Will Storey <will@summercat.com>
Willem van der Schyff <willemvds@gmail.com>
William Chan <willchan@chromium.org>
William Josephson <wjosephson@gmail.com>
William Orr <will@worrbase.com> <ay1244@gmail.com>
Wisdom Omuya <deafgoat@gmail.com>
Wu Yunzhou <yunzhouwu@gmail.com>
Xia Bin <snyh@snyh.org>
Xing Xing <mikespook@gmail.com>
Xu Fei <badgangkiller@gmail.com>
Xudong Zhang <felixmelon@gmail.com>
Xuyang Kang <xuyangkang@gmail.com>
Yan Zou <yzou@google.com>
@@ -1373,7 +1161,6 @@ Yann Kerhervé <yann.kerherve@gmail.com>
Yao Zhang <lunaria21@gmail.com>
Yasuharu Goto <matope.ono@gmail.com>
Yasuhiro Matsumoto <mattn.jp@gmail.com>
Yestin Sun <ylh@pdx.edu>
Yesudeep Mangalapilly <yesudeep@google.com>
Yissakhar Z. Beck <yissakhar.beck@gmail.com>
Yo-An Lin <yoanlin93@gmail.com>
@@ -1388,15 +1175,9 @@ Yuusei Kuwana <kuwana@kumama.org>
Yuval Pavel Zholkover <paulzhol@gmail.com>
Yves Junqueira <yvesj@google.com> <yves.junqueira@gmail.com>
Zac Bergquist <zbergquist99@gmail.com>
Zach Bintliff <zbintliff@gmail.com>
Zak <zrjknill@gmail.com>
Zakatell Kanda <hi@zkanda.io>
Zellyn Hunter <zellyn@squareup.com> <zellyn@gmail.com>
Zev Goldstein <zev.goldstein@gmail.com>
Zhongwei Yao <zhongwei.yao@arm.com>
Ziad Hatahet <hatahet@gmail.com>
Zorion Arrizabalaga <zorionk@gmail.com>
Максим Федосеев <max.faceless.frei@gmail.com>
Фахриддин Балтаев <faxriddinjon@gmail.com>
张嵩 <zs349596@gmail.com>
申习之 <bronze1man@gmail.com>

View File

@@ -4,7 +4,6 @@ Go is an open source programming language that makes it easy to build simple,
reliable, and efficient software.
![Gopher image](doc/gopher/fiveyears.jpg)
*Gopher image by [Renee French][rf], licensed under [Creative Commons 3.0 Attributions license][cc3-by].*
Our canonical Git repository is located at https://go.googlesource.com/go.
There is a mirror of the repository at https://github.com/golang/go.
@@ -40,6 +39,3 @@ Note that the Go project does not use GitHub pull requests, and that
we use the issue tracker for bug reports and proposals only. See
https://golang.org/wiki/Questions for a list of places to ask
questions about the Go language.
[rf]: https://reneefrench.blogspot.com/
[cc3-by]: https://creativecommons.org/licenses/by/3.0/

1
VERSION Normal file
View File

@@ -0,0 +1 @@
go1.8.3.typealias

View File

@@ -1,5 +1,4 @@
pkg encoding/json, method (*RawMessage) MarshalJSON() ([]uint8, error)
pkg math/big, type Word uintptr
pkg net, func ListenUnixgram(string, *UnixAddr) (*UDPConn, error)
pkg os (linux-arm), const O_SYNC = 4096
pkg os (linux-arm-cgo), const O_SYNC = 4096

View File

@@ -1,163 +0,0 @@
pkg crypto, const BLAKE2b_256 = 17
pkg crypto, const BLAKE2b_256 Hash
pkg crypto, const BLAKE2b_384 = 18
pkg crypto, const BLAKE2b_384 Hash
pkg crypto, const BLAKE2b_512 = 19
pkg crypto, const BLAKE2b_512 Hash
pkg crypto, const BLAKE2s_256 = 16
pkg crypto, const BLAKE2s_256 Hash
pkg crypto/x509, type Certificate struct, ExcludedDNSDomains []string
pkg database/sql, method (*Conn) BeginTx(context.Context, *TxOptions) (*Tx, error)
pkg database/sql, method (*Conn) Close() error
pkg database/sql, method (*Conn) ExecContext(context.Context, string, ...interface{}) (Result, error)
pkg database/sql, method (*Conn) PingContext(context.Context) error
pkg database/sql, method (*Conn) PrepareContext(context.Context, string) (*Stmt, error)
pkg database/sql, method (*Conn) QueryContext(context.Context, string, ...interface{}) (*Rows, error)
pkg database/sql, method (*Conn) QueryRowContext(context.Context, string, ...interface{}) *Row
pkg database/sql, method (*DB) Conn(context.Context) (*Conn, error)
pkg database/sql, type Conn struct
pkg database/sql, type Out struct
pkg database/sql, type Out struct, Dest interface{}
pkg database/sql, type Out struct, In bool
pkg database/sql, var ErrConnDone error
pkg database/sql/driver, type NamedValueChecker interface { CheckNamedValue }
pkg database/sql/driver, type NamedValueChecker interface, CheckNamedValue(*NamedValue) error
pkg database/sql/driver, var ErrRemoveArgument error
pkg encoding/asn1, const TagNull = 5
pkg encoding/asn1, const TagNull ideal-int
pkg encoding/asn1, var NullBytes []uint8
pkg encoding/asn1, var NullRawValue RawValue
pkg encoding/base32, const NoPadding = -1
pkg encoding/base32, const NoPadding int32
pkg encoding/base32, const StdPadding = 61
pkg encoding/base32, const StdPadding int32
pkg encoding/base32, method (Encoding) WithPadding(int32) *Encoding
pkg encoding/csv, type Reader struct, ReuseRecord bool
pkg encoding/json, func Valid([]uint8) bool
pkg go/ast, type TypeSpec struct, Assign token.Pos
pkg go/types, func SizesFor(string, string) Sizes
pkg go/types, method (*TypeName) IsAlias() bool
pkg hash/fnv, func New128() hash.Hash
pkg hash/fnv, func New128a() hash.Hash
pkg html/template, const ErrPredefinedEscaper = 11
pkg html/template, const ErrPredefinedEscaper ErrorCode
pkg image/png, type Encoder struct, BufferPool EncoderBufferPool
pkg image/png, type EncoderBuffer struct
pkg image/png, type EncoderBufferPool interface { Get, Put }
pkg image/png, type EncoderBufferPool interface, Get() *EncoderBuffer
pkg image/png, type EncoderBufferPool interface, Put(*EncoderBuffer)
pkg math/big, method (*Int) IsInt64() bool
pkg math/big, method (*Int) IsUint64() bool
pkg math/big, type Word uint
pkg math/bits, const UintSize = 64
pkg math/bits, const UintSize ideal-int
pkg math/bits, func LeadingZeros(uint) int
pkg math/bits, func LeadingZeros16(uint16) int
pkg math/bits, func LeadingZeros32(uint32) int
pkg math/bits, func LeadingZeros64(uint64) int
pkg math/bits, func LeadingZeros8(uint8) int
pkg math/bits, func Len(uint) int
pkg math/bits, func Len16(uint16) int
pkg math/bits, func Len32(uint32) int
pkg math/bits, func Len64(uint64) int
pkg math/bits, func Len8(uint8) int
pkg math/bits, func OnesCount(uint) int
pkg math/bits, func OnesCount16(uint16) int
pkg math/bits, func OnesCount32(uint32) int
pkg math/bits, func OnesCount64(uint64) int
pkg math/bits, func OnesCount8(uint8) int
pkg math/bits, func Reverse(uint) uint
pkg math/bits, func Reverse16(uint16) uint16
pkg math/bits, func Reverse32(uint32) uint32
pkg math/bits, func Reverse64(uint64) uint64
pkg math/bits, func Reverse8(uint8) uint8
pkg math/bits, func ReverseBytes(uint) uint
pkg math/bits, func ReverseBytes16(uint16) uint16
pkg math/bits, func ReverseBytes32(uint32) uint32
pkg math/bits, func ReverseBytes64(uint64) uint64
pkg math/bits, func RotateLeft(uint, int) uint
pkg math/bits, func RotateLeft16(uint16, int) uint16
pkg math/bits, func RotateLeft32(uint32, int) uint32
pkg math/bits, func RotateLeft64(uint64, int) uint64
pkg math/bits, func RotateLeft8(uint8, int) uint8
pkg math/bits, func TrailingZeros(uint) int
pkg math/bits, func TrailingZeros16(uint16) int
pkg math/bits, func TrailingZeros32(uint32) int
pkg math/bits, func TrailingZeros64(uint64) int
pkg math/bits, func TrailingZeros8(uint8) int
pkg mime, var ErrInvalidMediaParameter error
pkg mime/multipart, type FileHeader struct, Size int64
pkg mime/multipart, var ErrMessageTooLarge error
pkg net, method (*IPConn) SyscallConn() (syscall.RawConn, error)
pkg net, method (*TCPConn) SyscallConn() (syscall.RawConn, error)
pkg net, method (*UDPConn) SyscallConn() (syscall.RawConn, error)
pkg net, method (*UnixConn) SyscallConn() (syscall.RawConn, error)
pkg net, type Resolver struct, Dial func(context.Context, string, string) (Conn, error)
pkg net, type Resolver struct, StrictErrors bool
pkg net/http, func ServeTLS(net.Listener, Handler, string, string) error
pkg net/http, method (*Server) RegisterOnShutdown(func())
pkg net/http, method (*Server) ServeTLS(net.Listener, string, string) error
pkg net/http/fcgi, func ProcessEnv(*http.Request) map[string]string
pkg net/http/httptest, method (*Server) Certificate() *x509.Certificate
pkg net/http/httptest, method (*Server) Client() *http.Client
pkg reflect, func MakeMapWithSize(Type, int) Value
pkg runtime/pprof, func Do(context.Context, LabelSet, func(context.Context))
pkg runtime/pprof, func ForLabels(context.Context, func(string, string) bool)
pkg runtime/pprof, func Label(context.Context, string) (string, bool)
pkg runtime/pprof, func Labels(...string) LabelSet
pkg runtime/pprof, func SetGoroutineLabels(context.Context)
pkg runtime/pprof, func WithLabels(context.Context, LabelSet) context.Context
pkg runtime/pprof, type LabelSet struct
pkg sync, method (*Map) Delete(interface{})
pkg sync, method (*Map) Load(interface{}) (interface{}, bool)
pkg sync, method (*Map) LoadOrStore(interface{}, interface{}) (interface{}, bool)
pkg sync, method (*Map) Range(func(interface{}, interface{}) bool)
pkg sync, method (*Map) Store(interface{}, interface{})
pkg sync, type Map struct
pkg syscall (darwin-386-cgo), type Credential struct, NoSetGroups bool
pkg syscall (darwin-386), type Credential struct, NoSetGroups bool
pkg syscall (darwin-amd64-cgo), type Credential struct, NoSetGroups bool
pkg syscall (darwin-amd64), type Credential struct, NoSetGroups bool
pkg syscall (freebsd-386-cgo), func Pipe2([]int, int) error
pkg syscall (freebsd-386-cgo), type Credential struct, NoSetGroups bool
pkg syscall (freebsd-386), func Pipe2([]int, int) error
pkg syscall (freebsd-386), type Credential struct, NoSetGroups bool
pkg syscall (freebsd-amd64-cgo), func Pipe2([]int, int) error
pkg syscall (freebsd-amd64-cgo), type Credential struct, NoSetGroups bool
pkg syscall (freebsd-amd64), func Pipe2([]int, int) error
pkg syscall (freebsd-amd64), type Credential struct, NoSetGroups bool
pkg syscall (freebsd-arm-cgo), func Pipe2([]int, int) error
pkg syscall (freebsd-arm-cgo), type Credential struct, NoSetGroups bool
pkg syscall (freebsd-arm), func Pipe2([]int, int) error
pkg syscall (freebsd-arm), type Credential struct, NoSetGroups bool
pkg syscall (linux-386-cgo), type Credential struct, NoSetGroups bool
pkg syscall (linux-386), type Credential struct, NoSetGroups bool
pkg syscall (linux-amd64-cgo), type Credential struct, NoSetGroups bool
pkg syscall (linux-amd64), type Credential struct, NoSetGroups bool
pkg syscall (linux-arm-cgo), type Credential struct, NoSetGroups bool
pkg syscall (linux-arm), type Credential struct, NoSetGroups bool
pkg syscall (netbsd-386-cgo), type Credential struct, NoSetGroups bool
pkg syscall (netbsd-386), type Credential struct, NoSetGroups bool
pkg syscall (netbsd-amd64-cgo), type Credential struct, NoSetGroups bool
pkg syscall (netbsd-amd64), type Credential struct, NoSetGroups bool
pkg syscall (netbsd-arm-cgo), type Credential struct, NoSetGroups bool
pkg syscall (netbsd-arm), type Credential struct, NoSetGroups bool
pkg syscall (openbsd-386-cgo), type Credential struct, NoSetGroups bool
pkg syscall (openbsd-386), type Credential struct, NoSetGroups bool
pkg syscall (openbsd-amd64-cgo), type Credential struct, NoSetGroups bool
pkg syscall (openbsd-amd64), type Credential struct, NoSetGroups bool
pkg syscall (windows-386), const WSAECONNABORTED = 10053
pkg syscall (windows-386), const WSAECONNABORTED Errno
pkg syscall (windows-amd64), const WSAECONNABORTED = 10053
pkg syscall (windows-amd64), const WSAECONNABORTED Errno
pkg syscall, type Conn interface { SyscallConn }
pkg syscall, type Conn interface, SyscallConn() (RawConn, error)
pkg syscall, type RawConn interface { Control, Read, Write }
pkg syscall, type RawConn interface, Control(func(uintptr)) error
pkg syscall, type RawConn interface, Read(func(uintptr) bool) error
pkg syscall, type RawConn interface, Write(func(uintptr) bool) error
pkg testing, method (*B) Helper()
pkg testing, method (*T) Helper()
pkg testing, type TB interface, Helper()
pkg time, method (Duration) Round(Duration) Duration
pkg time, method (Duration) Truncate(Duration) Duration

View File

@@ -20,7 +20,7 @@ trap cleanup 0 INT
rm -f get.bin final-test.bin a.out
# If called with -all, check that all code snippets compile.
if [ "$1" = "-all" ]; then
if [ "$1" == "-all" ]; then
for fn in *.go; do
go build -o a.out $fn
done

View File

@@ -22,8 +22,6 @@ using the go <code>tool</code> subcommand, such as <code>go tool vet</code>.
This style of invocation allows, for instance, checking a single source file
rather than an entire package: <code>go tool vet myprogram.go</code> as
compared to <code>go vet mypackage</code>.
Some of the commands, such as <code>pprof</code>, are accessible only through
the go <code>tool</code> subcommand.
</p>
<p>
@@ -62,7 +60,7 @@ details.
</tr>
<tr>
<td><a href="/cmd/cover/">cover</a></td>
<td><a href="//godoc.org/golang.org/x/tools/cmd/cover/">cover</a></td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>Cover is a program for creating and analyzing the coverage profiles
generated by <code>"go test -coverprofile"</code>.</td>

View File

@@ -124,12 +124,8 @@ workspace. It defaults to a directory named <code>go</code> inside your home dir
so <code>$HOME/go</code> on Unix,
<code>$home/go</code> on Plan 9,
and <code>%USERPROFILE%\go</code> (usually <code>C:\Users\YourName\go</code>) on Windows.
</p>
<p>
If you would like to work in a different location, you will need to
<a href="https://golang.org/wiki/SettingGOPATH">set <code>GOPATH</code></a>
to the path to that directory.
If you would like to work in a different location, you will need to set
<code>GOPATH</code> to the path to that directory.
(Another common setup is to set <code>GOPATH=$HOME</code>.)
Note that <code>GOPATH</code> must <b>not</b> be the
same path as your Go installation.

View File

@@ -30,25 +30,6 @@ You must go through the following process <em>prior to contributing</em>.
You only need to do this once per Google Account.
</p>
<h2 id="go-contrib-init">Automatically set up &amp; diagnose your development environment</h3>
<p>
The <code>go-contrib-init</code> tool configures and debugs your Go
development environment, automatically performing many of the steps
on this page, or telling you what you need to do next. If you wish
to use it, run:
</p>
<pre>
$ go get -u golang.org/x/tools/cmd/go-contrib-init
$ cd /code/to/edit
$ go-contrib-init
</pre>
<p>
The tool will either set things up, tell you that everything is
configured, or tell you what steps you need to do manually.
</p>
<h2 id="auth">Configure Git to use Gerrit</h2>
<p>
You'll need a web browser and a command line terminal.
@@ -137,10 +118,10 @@ it does not need to be completed again.</i>
You can see your currently signed agreements and sign new ones through the Gerrit
interface.
To do this, <a href="https://go-review.googlesource.com/login/">Log into Gerrit</a>,
then visit the <a href="https://go-review.googlesource.com/settings/agreements">Agreements</a>
page.
If you do not have a signed agreement listed there, you can create one
by clicking "New Contributor Agreement" and following the steps.
click your name in the upper-right, choose "Settings", then select "Agreements"
from the topics on the left.
If you do not have a signed agreement listed here,
you can create one by clicking "New Contributor Agreement" and following the steps.
</p>
<p>
@@ -324,10 +305,10 @@ Go to a directory where you want the source to appear and run the following
command in a terminal.
</p>
<pre>
<pre><code>
$ git clone https://go.googlesource.com/go
$ cd go
</pre>
</code></pre>
<h3 id="master">Contributing to the main Go tree</h3>
@@ -415,9 +396,8 @@ and
<p>
Once you have the changes queued up, you will want to commit them.
In the Go contribution workflow this is done with a <code>git</code>
<code>change</code> command, which creates a local branch and commits the changes
directly to that local branch.
In the Go contribution workflow this is done with a `git change` command,
which creates a local branch and commits the changes directly to that local branch.
</p>
<pre>
@@ -438,9 +418,9 @@ then <code>git</code> <code>commit</code>.)
</p>
<p>
As the <code>git</code> <code>commit</code> is the final step, Git will open an
editor to ask for a commit message. (It uses the editor named by
the <code>$EDITOR</code> environment variable,
As the `git commit` is the final step, Git will open an editor to ask for a
commit message.
(It uses the editor named by the <code>$EDITOR</code> environment variable,
<code>vi</code> by default.)
The file will look like:
@@ -591,7 +571,7 @@ changes to Gerrit using <code>git</code> <code>push</code> <code>origin</code>
<p>
If your change relates to an open issue, please add a comment to the issue
announcing your proposed fix, including a link to your change.
announcing your proposed fix, including a link to your CL.
</p>
<p>

View File

@@ -15,12 +15,19 @@ git checkout <i>release-branch</i>
<h2 id="policy">Release Policy</h2>
<p>
Each major Go release is supported until there are two newer major releases.
For example, Go 1.8 is supported until Go 1.10 is released,
and Go 1.9 is supported until Go 1.11 is released.
We fix critical problems, including <a href="/security">critical security problems</a>,
in supported releases as needed by issuing minor revisions
(for example, Go 1.8.1, Go 1.8.2, and so on).
Each major Go release obsoletes and ends support for the previous one.
For example, if Go 1.5 has been released, then it is the current release
and Go 1.4 and earlier are no longer supported.
We fix critical problems in the current release as needed by issuing minor revisions
(for example, Go 1.5.1, Go 1.5.2, and so on).
</p>
<p>
As a special case, we issue minor revisions for critical security problems
in both the current release and the previous release.
For example, if Go 1.5 is the current release then we will issue minor revisions
to fix critical security problems in both Go 1.4 and Go 1.5 as they arise.
See the <a href="/security">security policy</a> for more details.
</p>
<h2 id="go1.8">go1.8 (released 2017/02/16)</h2>

View File

@@ -1580,7 +1580,7 @@ if attended[person] { // will be false if person is not in the map
<p>
Sometimes you need to distinguish a missing entry from
a zero value. Is there an entry for <code>"UTC"</code>
or is that 0 because it's not in the map at all?
or is that the empty string because it's not in the map at all?
You can discriminate with a form of multiple assignment.
</p>
<pre>
@@ -1833,7 +1833,7 @@ for a min function that chooses the least of a list of integers:
</p>
<pre>
func Min(a ...int) int {
min := int(^uint(0) &gt;&gt; 1) // largest int
min := int(^uint(0) >> 1) // largest int
for _, i := range a {
if i &lt; min {
min = i

55
doc/go1.8.txt Normal file
View File

@@ -0,0 +1,55 @@
This file lists things yet to be moved into go1.8.html or deemed too
minor to mention. Either way, delete from here when done.
Tools:
go: -buildmode=c-archive now builds PIC on ELF (CL 24180)
go: mobile pkg dir change, recommend using go list in scripts (CL 24930, CL 27929)
go, dist: can set default pkg-config tool using PKG_CONFIG env var (CL 29991)
go: can set secure/insecure GIT schemes using GIT_ALLOW_PROTOCOL env var (CL 30135)
API additions and behavior changes:
cmd/compile, runtime, etc: get rid of constant FP registers (CL 28095)
cmd/compile, runtime: add go:yeswritebarrierrec pragma (CL 30938)
cmd/compile/internal/gc: enable new parser by default (CL 27203)
cmd/compile/internal/syntax: fast Go syntax trees, initial commit (CL 27195)
cmd/compile: add compiler phase timing (CL 24462)
cmd/compile: add inline explainer (CL 22782)
cmd/compile: enable flag-specified dump of specific phase+function (CL 23044)
cmd/internal/obj, cmd/link: darwin dynlink support (CL 29393)
cmd/internal/objfile: add ppc64/ppc64le disassembler support (CL 9682)
cmd/link, cmd/go: delay linking of mingwex and mingw32 until very end (CL 26670)
cmd/link: R_ADDR dynamic relocs for internal PIE (CL 29118)
cmd/link: add trampolines for too far calls in ppc64x (CL 30850)
cmd/link: allow internal PIE linking (CL 28543)
cmd/link: fix -X importpath.name=value when import path needs escaping (CL 31970)
cmd/link: fix -buildmode=pie / -linkshared combination (CL 28996)
cmd/link: for -buildmode=exe pass -no-pie to external linker (CL 33106)
cmd/link: insert trampolines for too-far jumps on ARM (CL 29397)
cmd/link: non-executable stack support for Solaris (CL 24142)
cmd/link: put text at address 0x1000000 on darwin/amd64 (CL 32185)
cmd/link: remove the -shared flag (CL 28852)
cmd/link: split large elf text sections on ppc64x (CL 27790)
cmd/link: trampoline support for external linking on ARM (CL 31143)
cmd/objdump: implement objdump of .o files (CL 24818)
go/build: allow % in ${SRCDIR} expansion for Jenkins (CL 31611)
go/build: do not record go:binary-only-package if build tags not satisfied (CL 31577)
go/build: implement default GOPATH (CL 32019)
runtime/race: update race runtime (CL 32160)
runtime: assume 64kB physical pages on ARM (CL 25021)
runtime: disable stack rescanning by default (CL 31766)
runtime: don't call cgocallback from signal handler (CL 30218)
runtime: fix check for vacuous page boundary rounding (CL 27230)
runtime: fix map iterator concurrent map check (CL 24749)
runtime: fix newextram PC passed to race detector (CL 29712)
runtime: implement unconditional hybrid barrier (CL 31765)
runtime: include pre-panic/throw logs in core dumps (CL 32013)
runtime: limit the number of map overflow buckets (CL 25049)
runtime: pass windows float syscall args via XMM (CL 32173)
runtime: print sigcode on signal crash (CL 32183)
runtime: record current PC for SIGPROF on non-Go thread (CL 30252)
runtime: sleep on CLOCK_MONOTONIC in futexsleep1 on freebsd (CL 30154)

View File

@@ -1,822 +0,0 @@
<!--{
"Title": "Go 1.9 Release Notes",
"Path": "/doc/go1.9",
"Template": true
}-->
<!--
NOTE: In this document and others in this directory, the convention is to
set fixed-width phrases with non-fixed-width spaces, as in
<code>hello</code> <code>world</code>.
Do not send CLs removing the interior tags from such phrases.
-->
<style>
ul li { margin: 0.5em 0; }
</style>
<h2 id="introduction">DRAFT RELEASE NOTES - Introduction to Go 1.9</h2>
<p><strong>
Go 1.9 is not yet released. These are work-in-progress
release notes. Go 1.9 is expected to be released in August 2017.
</strong></p>
<p>
The latest Go release, version 1.9, arrives six months
after <a href="go1.8">Go 1.8</a> and is the tenth release in
the <a href="https://golang.org/doc/devel/release.html">Go 1.x
series</a>.
There is one <a href="#language">change to the language</a>, adding
support for type aliases.
Most of the changes are in the implementation of the toolchain,
runtime, and libraries.
As always, the release maintains the Go 1
<a href="/doc/go1compat.html">promise of compatibility</a>.
We expect almost all Go programs to continue to compile and run as
before.
</p>
<p>
The release
adds <a href="#monotonic-time">transparent monotonic time support</a>,
<a href="#parallel-compile">parallelizes compilation of functions</a> within a package,
better supports <a href="#test-helper">test helper functions</a>,
includes a new <a href="#math-bits">bit manipulation package</a>,
and has a new <a href="#sync-map">concurrent map type</a>.
</p>
<h2 id="language">Changes to the language</h2>
<p>
There is one change to the language.
Go now supports type aliases to support gradual code repair while
moving a type between packages.
The <a href="https://golang.org/design/18130-type-alias">type alias
design document</a>
and <a href="https://talks.golang.org/2016/refactor.article">an
article on refactoring</a> cover the problem in detail.
In short, a type alias declaration has the form:
</p>
<pre>
type T1 = T2
</pre>
<p>
This declaration introduces an alias name <code>T1</code>—an
alternate spelling—for the type denoted by <code>T2</code>; that is,
both <code>T1</code> and <code>T2</code> denote the same type.
</p>
<h2 id="ports">Ports</h2>
<p>
There are no new supported operating systems or processor
architectures in this release.
</p>
<h3 id="power8">ppc64x requires Power8</h3>
<p> <!-- CL 36725, CL 36832 -->
Both <code>GOARCH=ppc64</code> and <code>GOARCH=ppc64le</code> now
require at least Power8 support. In previous releases,
only <code>GOARCH=ppc64le</code> required Power8 and the big
endian <code>ppc64</code> architecture supported older
hardware.
<p>
<h3 id="known_issues">Known Issues</h3>
<p>
There are some instabilities on FreeBSD that are known but not understood.
These can lead to program crashes in rare cases.
See <a href="https://golang.org/issue/15658">issue 15658</a>.
Any help in solving this FreeBSD-specific issue would be appreciated.
</p>
<h2 id="tools">Tools</h2>
<h3 id="parallel-compile">Parallel Compilation</h3>
<p>
The Go compiler now supports compiling a package's functions in parallel, taking
advantage of multiple cores. This is in addition to the <code>go</code> command's
existing support for parallel compilation of separate packages.
Parallel compilation is on by default, but can be disabled by setting the
environment variable <code>GO19CONCURRENTCOMPILATION</code> to <code>0</code>.
</p>
<h3 id="vendor-dotdotdot">Vendor matching with ./...</h3>
<p><!-- CL 38745 -->
By popular request, <code>./...</code> no longer matches packages
in <code>vendor</code> directories in tools accepting package names,
such as <code>go</code> <code>test</code>. To match vendor
directories, write <code>./vendor/...</code>.
</p>
<h3 id="compiler">Compiler Toolchain</h3>
<p><!-- CL 37441 -->
Complex division is now C99-compatible. This has always been the
case in gccgo and is now fixed in the gc toolchain.
</p>
<p> <!-- CL 36983 -->
The linker will now generate DWARF information for cgo executables on Windows.
</p>
<p> <!-- CL 44210, CL 40095 -->
The compiler now includes lexical scopes in the generated DWARF, allowing
debuggers to hide variables that are not in scope. The <code>.debug_info</code>
section is now DWARF version 4.
</p>
<p> <!-- CL 43855 -->
The values of <code>GOARM</code> and <code>GO386</code> now affect a
compiled package's build ID, as used by the <code>go</code> tool's
dependency caching.
</p>
<h3 id="go-doc">Doc</h3>
<p><!-- CL 36031 -->
Long lists of arguments are now truncated. This improves the readability
of <code>go doc</code> on some generated code.
</p>
<p><!-- CL 38438 -->
Viewing documentation on struct fields is now supported with
<code>go doc struct.field</code>.
</p>
<h3 id="go-env-json">Env</h3>
<p> <!-- CL 38757 -->
The new <code>go</code> <code>env</code> <code>-json</code> flag
enables JSON output, instead of the default OS-specific output
format.
</p>
<h3 id="go-test-list">Test</h3>
<p> <!-- CL 41195 -->
The <a href="/cmd/go/#hdr-Description_of_testing_flags"><code>go</code> <code>test</code></a>
command accepts a new <code>-list</code> flag, which takes a regular
expression as an argument and prints to stdout the name of any
tests, benchmarks, or examples that match it, without running them.
</p>
<h3 id="go-tool-pprof-proxy">Pprof</h3>
<p> <!-- CL 38343 -->
The <code>go</code> <code>tool</code> <code>pprof</code> command now
uses the HTTP proxy information defined in the environment, using
<a href="/pkg/net/http/#ProxyFromEnvironment"><code>http.ProxyFromEnvironment</code></a>.
</p>
<h3 id="tools-TODO">TODO</h3>
<p>TODO: finish documenting misc tool changes</p>
<pre>
CL 42028: https://golang.org/cl/42028: cmd/asm: fix operand order of ARM's MULA instruction
CL 40112: https://golang.org/cl/40112: cmd/go: allow full flag processing in go vet
CL 42990: https://golang.org/cl/42990: cmd/internal/obj/x86: add ADDSUBPS/PD
CL 40331: https://golang.org/cl/40331: cmd/link,runtime/cgo: enable PT_TLS generation on OpenBSD
</pre>
<h2 id="performance">Performance</h2>
<p>
As always, the changes are so general and varied that precise
statements about performance are difficult to make. Most programs
should run a bit faster, due to speedups in the garbage collector,
better generated code, and optimizations in the core library.
</p>
<h3 id="gc">Garbage Collector</h3>
<p> <!-- CL 37520 -->
Library functions that used to trigger stop-the-world garbage
collection now trigger concurrent garbage collection.
Specifically, <a href="/pkg/runtime/#GC"><code>runtime.GC</code></a>,
<a href="/pkg/runtime/debug/#SetGCPercent"><code>debug.SetGCPercent</code></a>,
and
<a href="/pkg/runtime/debug/#FreeOSMemory"><code>debug.FreeOSMemory</code></a>,
now trigger concurrent garbage collection, blocking only the calling
goroutine until the garbage collection is done.
</p>
<p> <!-- CL 34103, CL 39835 -->
The
<a href="/pkg/runtime/debug/#SetGCPercent"><code>debug.SetGCPercent</code></a>
function only triggers a garbage collection if one is immediately
necessary because of the new GOGC value.
This makes it possible to adjust GOGC on-the-fly.
</p>
<p> <!-- CL 38732 -->
Large object allocation performance is significantly improved in
applications using large (&gt;50GB) heaps containing many large
objects.
</p>
<p> <!-- CL 34937 -->
The <a href="/pkg/runtime/#ReadMemStats"><code>runtime.ReadMemStats</code></a>
function now takes less than 100µs even for very large heaps.
</p>
<h2 id="library">Core library</h2>
<h3 id="monotonic-time">Transparent Monotonic Time support</h3>
<p> <!-- CL 36255 -->
The <a href="/pkg/time/"><code>time</code></a> package now transparently
tracks monotonic time in each <a href="/pkg/time/#Time"><code>Time</code></a>
value, making computing durations between two <code>Time</code> values
a safe operation in the presence of wall clock adjustments.
See the <a href="/pkg/time/#hdr-Monotonic_Clocks">package docs</a> and
<a href="https://golang.org/design/12914-monotonic">design document</a>
for details.
</p>
<h3 id="math-bits">New bit manipulation package</h3>
<p> <!-- CL 36315 -->
Go 1.9 includes a new package,
<a href="/pkg/math/bits/"><code>math/bits</code></a>, with optimized
implementations for manipulating bits. On most architectures
functions in this package are additionally recognized by the
compiler and treated as intrinsics for additional performance.
</p>
<h3 id="test-helper">Test Helper Functions</h3>
<p> <!-- CL 38796 -->
The
new <a href="/pkg/testing/#T.Helper"><code>(*T).Helper</code></a>
and <a href="/pkg/testing/#B.Helper"><code>(*B).Helper</code></a>
methods mark the calling function as a test helper function. When
printing file and line information, that function will be skipped.
This permits writing test helper functions while still having useful
line numbers for users.
</p>
<h3 id="sync-map">Concurrent Map</h3>
<p> <!-- CL 36617 -->
The new <a href="/pkg/sync/#Map"><code>Map</code></a> type
in the <a href="/pkg/sync/"><code>sync</code></a> package
is a concurrent map with amortized-constant-time loads, stores, and
deletes. It is safe for multiple goroutines to call a Map's methods
concurrently.
</p>
<h3 id="minor_library_changes">Minor changes to the library</h3>
<p>
As always, there are various minor changes and updates to the library,
made with the Go 1 <a href="/doc/go1compat">promise of compatibility</a>
in mind.
</p>
<dl id="archive/zip"><dt><a href="/pkg/archive/zip/">archive/zip</a></dt>
<dd>
<p><!-- CL 39570 -->
The
ZIP <a href="/pkg/archive/zip/#Writer"><code>Writer</code></a>
now sets the UTF-8 bit in
the <a href="/pkg/archive/zip/#FileHeader.Flags"><code>FileHeader.Flags</code></a>
when appropriate.
</p>
</dl><!-- archive/zip -->
<dl id="crypto/rand"><dt><a href="/pkg/crypto/rand/">crypto/rand</a></dt>
<dd>
<p><!-- CL 43852 -->
On Linux, Go now calls the <code>getrandom</code> system call
without the <code>GRND_NONBLOCK</code> flag; it will now block
until the kernel has sufficient randomness. On kernels predating
the <code>getrandom</code> system call, Go continues to read
from <code>/dev/urandom</code>.
</p>
</dl><!-- crypto/rand -->
<dl id="crypto/x509"><dt><a href="/pkg/crypto/x509/">crypto/x509</a></dt>
<dd>
<p><!-- CL 36093 -->
On Unix systems the environment
variables <code>SSL_CERT_FILE</code>
and <code>SSL_CERT_DIR</code> can now be used to override the
system default locations for the SSL certificate file and SSL
certificate files directory, respectively.
</p>
<p>The FreeBSD path <code>/usr/local/etc/ssl/cert.pem</code> is
now included in the certificate search path.
</p>
<p><!-- CL 36900 -->
The package now supports excluded domains in name constraints.
In addition to enforcing such constraints,
<a href="/pkg/crypto/x509/#CreateCertificate"><code>CreateCertificate</code></a>
will create certificates with excluded name constraints
if the provided template certificate has the new
field
<a href="/pkg/crypto/x509/#Certificate.ExcludedDNSDomains"><code>ExcludedDNSDomains</code></a>
populated.
</p>
</dl><!-- crypto/x509 -->
<dl id="database/sql"><dt><a href="/pkg/database/sql/">database/sql</a></dt>
<dd>
<p><!-- CL 35476 -->
The package will now use a cached <a href="/pkg/database/sql/#Stmt"><code>Stmt</code></a> if
available in <a href="/pkg/database/sql/#Tx.Stmt"><code>Tx.Stmt</code></a>.
This prevents statements from being re-prepared each time
<a href="/pkg/database/sql/#Tx.Stmt"><code>Tx.Stmt</code></a> is called.
</p>
<p><!-- CL 38533 -->
The package now allows drivers to implement their own argument checkers by implementing
<a href="/pkg/database/sql/driver/#NamedValueChecker"><code>driver.NamedValueChecker</code></a>.
This also allows drivers to support <code>OUTPUT</code> and <code>INOUT</code> parameter types.
<a href="/pkg/database/sql/#Out"><code>Out</code></a> should be used to return output parameters
when supported by the driver.
</p>
<p><!-- CL 39031 -->
<a href="/pkg/database/sql/#Rows.Scan"><code>Rows.Scan</code></a> can now scan user-defined string types.
Previously the package supported scanning into numeric types like <code>type Int int64</code>. It now also supports
scanning into string types like <code>type String string</code>.
</p>
<p><!-- CL 40694 -->
The new <a href="/pkg/database/sql/#DB.Conn"><code>DB.Conn</code></a> method returns the new
<a href="/pkg/database/sql/#Conn"><code>Conn</code></a> type representing an
exclusive connection to the database from the connection pool. All queries run on
a <a href="/pkg/database/sql/#Conn"><code>Conn</code></a> will use the same underlying
connection until <a href="/pkg/database/sql/#Conn.Close"><code>Conn.Close</code></a> is called
to return the connection to the connection pool.
</p>
</dl><!-- database/sql -->
<dl id="encoding/asn1"><dt><a href="/pkg/encoding/asn1/">encoding/asn1</a></dt>
<dd>
<p><!-- CL 38660 -->
The new
<a href="/pkg/encoding/asn1/#NullBytes"><code>NullBytes</code></a>
and
<a href="/pkg/encoding/asn1/#NullRawValue"><code>NullRawValue</code></a>
represent the <code>ASN.1 NULL</code> type.
</p>
</dl><!-- encoding/asn1 -->
<dl id="encoding/base32"><dt><a href="/pkg/encoding/base32/">encoding/base32</a></dt>
<dd>
<p><!-- CL 38634 -->
The new <a href="/pkg/encoding/base32/#Encoding.WithPadding">Encoding.WithPadding</a>
method adds support for custom padding characters and disabling padding.
</p>
</dl><!-- encoding/base32 -->
<dl id="encoding/csv"><dt><a href="/pkg/encoding/csv/">encoding/csv</a></dt>
<dd>
<p><!-- CL 41730 -->
The new field
<a href="/pkg/encoding/csv/#Reader.ReuseRecord"><code>Reader.ReuseRecord</code></a>
controls whether calls to
<a href="/pkg/encoding/csv/#Reader.Read"><code>Read</code></a>
may return a slice sharing the backing array of the previous
call's returned slice for improved performance.
</p>
</dl><!-- encoding/csv -->
<dl id="fmt"><dt><a href="/pkg/fmt/">fmt</a></dt>
<dd>
<p><!-- CL 37051 -->
The sharp flag ('<code>#</code>') is now supported when printing
floating point and complex numbers. It will always print a
decimal point
for <code>%e</code>, <code>%E</code>, <code>%f</code>, <code>%F</code>, <code>%g</code>
and <code>%G</code>; it will not remove trailing zeros
for <code>%g</code> and <code>%G</code>.
</p>
</dl><!-- fmt -->
<dl id="hash/fnv"><dt><a href="/pkg/hash/fnv/">hash/fnv</a></dt>
<dd>
<p><!-- CL 38356 -->
The package now includes 128-bit FNV-1 and FNV-1a hash support with
<a href="/pkg/hash/fnv/#New128"><code>New128</code></a> and
<a href="/pkg/hash/fnv/#New128a"><code>New128a</code></a>, respectively.
</p>
</dl><!-- hash/fnv -->
<dl id="html/template"><dt><a href="/pkg/html/template/">html/template</a></dt>
<dd>
<p><!-- CL 37880, CL 40936 -->
The package now reports an error if a predefined escaper (one of
"html", "urlquery" and "js") is found in a pipeline and its
rewriting by the contextual auto-escaper could potentially lead
to security or correctness issues.
</p>
</dl><!-- html/template -->
<dl id="image"><dt><a href="/pkg/image/">image</a></dt>
<dd>
<p><!-- CL 36734 -->
The <a href="/pkg/image/#Rectangle.Intersect"><code>Rectangle.Intersect</code></a>
method now returns a zero <code>Rectangle</code> when called on
adjacent but non-overlapping rectangles, as documented. In
earlier releases it would incorrectly return an empty but
non-zero <code>Rectangle</code>.
</p>
</dl><!-- image -->
<dl id="image/color"><dt><a href="/pkg/image/color/">image/color</a></dt>
<dd>
<p><!-- CL 36732 -->
The YCbCr to RGBA conversion formula has been tweaked to ensure
that rounding adjustments span the complete [0, 0xffff] RGBA
range.
</p>
</dl><!-- image/color -->
<dl id="image/png"><dt><a href="/pkg/image/png/">image/png</a></dt>
<dd>
<p><!-- CL 34150 -->
The new <a href="/pkg/image/png/#Encoder.BufferPool"><code>Encoder.BufferPool</code></a>
field allows specifying an <a href="/pkg/image/png/#EncoderBufferPool"><code>EncoderBufferPool</code></a>,
that will be used by the encoder to get temporary <code>EncoderBuffer</code>
buffers when encoding a PNG image.
The use of a <code>BufferPool</code> reduces the number of
memory allocations performed while encoding multiple images.
</p>
<p><!-- CL 38271 -->
The package now supports the decoding of transparent 8-bit
grayscale ("Gray8") images.
</p>
</dl><!-- image/png -->
<dl id="math/big"><dt><a href="/pkg/math/big/">math/big</a></dt>
<dd>
<p><!-- CL 36487 -->
The new
<a href="/pkg/math/big/#Int.IsInt64"><code>IsInt64</code></a>
and
<a href="/pkg/math/big/#Int.IsUint64"><code>IsUint64</code></a>
methods report whether an <code>Int</code>
may be represented as an <code>int64</code> or <code>uint64</code>
value.
</p>
</dl><!-- math/big -->
<dl id="mime/multipart"><dt><a href="/pkg/mime/multipart/">mime/multipart</a></dt>
<dd>
<p><!-- CL 39223 -->
The new
<a href="/pkg/mime/multipart/#FileHeader.Size"><code>FileHeader.Size</code></a>
field describes the size of a file in a multipart message.
</p>
</dl><!-- mime/multipart -->
<dl id="net"><dt><a href="/pkg/net/">net</a></dt>
<dd>
<p><!-- CL 32572 -->
The new
<a href="/pkg/net/#Resolver.StrictErrors"><code>Resolver.StrictErrors</code></a>
provides control over how Go's built-in DNS resolver handles
temporary errors during queries composed of multiple sub-queries,
such as an A+AAAA address lookup.
</p>
<p><!-- CL 37260 -->
The new
<a href="/pkg/net/#Resolver.Dial"><code>Resolver.Dial</code></a>
allows a <code>Resolver</code> to use a custom dial function.
</p>
<p><!-- CL 40510 -->
<a href="/pkg/net/#JoinHostPort"><code>JoinHostPort</code></a> now only places an address in square brackets if the host contains a colon.
In previous releases it would also wrap addresses in square brackets if they contained a percent ('<code>%</code>') sign.
</p>
<p><!-- CL 37913 -->
The new methods
<a href="/pkg/net/#TCPConn.SyscallConn"><code>TCPConn.SyscallConn</code></a>,
<a href="/pkg/net/#IPConn.SyscallConn"><code>IPConn.SyscallConn</code></a>,
<a href="/pkg/net/#UDPConn.SyscallConn"><code>UDPConn.SyscallConn</code></a>,
and
<a href="/pkg/net/#UnixConn.SyscallConn"><code>UnixConn.SyscallConn</code></a>
provide access to the connections' underlying file descriptors.
</p>
<p><!-- 45088 -->
It is now safe to call <a href="/pkg/net/#Dial"><code>Dial</code></a> with the address obtained from
<code>(*TCPListener).String()</code> after creating the listener with
<code><a href="/pkg/net/#Listen">Listen</a>("tcp", ":0")</code>.
Previously it failed on some machines with half-configured IPv6 stacks.
</p>
</dl><!-- net -->
<dl id="net/http"><dt><a href="/pkg/net/http/">net/http</a></dt>
<dd>
<p>Server changes:</p>
<ul>
<li><!-- CL 38194 -->
<a href="/pkg/net/http/#ServeMux"><code>ServeMux</code></a> now ignores ports in the host
header when matching handlers. The host is matched unmodified for <code>CONNECT</code> requests.
</li>
<li><!-- CL 34727 -->
<a href="/pkg/net/http/#Server.WriteTimeout"><code>Server.WriteTimeout</code></a>
now applies to HTTP/2 connections and is enforced per-stream.
</li>
<li><!-- CL 43231 -->
HTTP/2 now uses the priority write scheduler by default.
Frames are scheduled by following HTTP/2 priorities as described in
<a href="https://tools.ietf.org/html/rfc7540#section-5.3">RFC 7540 Section 5.3</a>.
</li>
</ul>
<p>Client &amp; Transport changes:</p>
<ul>
<li><!-- CL 35488 -->
The <a href="/pkg/net/http/#Transport"><code>Transport</code></a>
now supports making requests via SOCKS5 proxy when the URL returned by
<a href="/net/http/#Transport.Proxy"><code>Transport.Proxy</code></a>
has the scheme <code>socks5</code>.
</li>
</ul>
</dl><!-- net/http -->
<dl id="net/http/fcgi"><dt><a href="/pkg/net/http/fcgi/">net/http/fcgi</a></dt>
<dd>
<p><!-- CL 40012 -->
The new
<a href="/pkg/net/http/fcgi/#ProcessEnv"><code>ProcessEnv</code></a>
function returns FastCGI environment variables associated with an HTTP request
for which there are no appropriate
<a href="/pkg/net/http/#Request"><code>http.Request</code></a>
fields, such as <code>REMOTE_USER</code>.
</p>
</dl><!-- net/http/fcgi -->
<dl id="net/http/httptest"><dt><a href="/pkg/net/http/httptest/">net/http/httptest</a></dt>
<dd>
<p><!-- CL 34639 -->
The new
<a href="/pkg/net/http/httptest/#Server.Client"><code>Server.Client</code></a>
method returns an HTTP client configured for making requests to the test server.
</p>
<p>
The new
<a href="/pkg/net/http/httptest/#Server.Certificate"><code>Server.Certificate</code></a>
method returns the test server's TLS certificate, if any.
</p>
</dl><!-- net/http/httptest -->
<dl id="os"><dt><a href="/pkg/os/">os</a></dt>
<dd>
<p><!-- CL 36800 -->
The <code>os</code> package now uses the internal runtime poller
for file I/O.
This reduces the number of threads required for read/write
operations on pipes, and eliminates races when one goroutine
closes a file while another using it for I/O.
</p>
<dd>
<p><!-- CL 37915 -->
On Windows,
<a href="/pkg/os/#Args"><code>Args</code></a>
is now populated without <code>shell32.dll</code>, improving process start-up time by 1-7 ms.
</p>
</dl><!-- os -->
<dl id="os/exec"><dt><a href="/pkg/os/exec/">os/exec</a></dt>
<dd>
<p><!-- CL 37586 -->
The <code>os/exec</code> package now prevents child processes from being created with
any duplicate environment variables.
If <a href="/pkg/os/exec/#Cmd.Env"><code>Cmd.Env</code></a>
contains duplicate environment keys, only the last
value in the slice for each duplicate key is used.
</p>
</dl><!-- os/exec -->
<dl id="os/user"><dt><a href="/pkg/os/user/">os/user</a></dt>
<dd>
<p><!-- CL 37664 -->
<a href="/pkg/os/user/#Lookup"><code>Lookup</code></a> and
<a href="/pkg/os/user/#LookupId"><code>LookupId</code></a> now
work on Unix systems when <code>CGO_ENABLED=0</code> by reading
the <code>/etc/passwd</code> file.
</p>
<p><!-- CL 33713 -->
<a href="/pkg/os/user/#LookupGroup"><code>LookupGroup</code></a> and
<a href="/pkg/os/user/#LookupGroupId"><code>LookupGroupId</code></a> now
work on Unix systems when <code>CGO_ENABLED=0</code> by reading
the <code>/etc/group</code> file.
</p>
</dl><!-- os/user -->
<dl id="reflect"><dt><a href="/pkg/reflect/">reflect</a></dt>
<dd>
<p><!-- CL 38335 -->
The new
<a href="/pkg/reflect/#MakeMapWithSize"><code>MakeMapWithSize</code></a>
function creates a map with a capacity hint.
</p>
</dl><!-- reflect -->
<dl id="runtime"><dt><a href="/pkg/runtime/">runtime</a></dt>
<dd>
<p><!-- CL 37233, CL 37726 -->
Tracebacks generated by the runtime and recorded in profiles are
now accurate in the presence of inlining.
To retrieve tracebacks programmatically, applications should use
<a href="/pkg/runtime/#CallersFrames"><code>runtime.CallersFrames</code></a>
rather than directly iterating over the results of
<a href="/pkg/runtime/#Callers"><code>runtime.Callers</code></a>.
</p>
<p><!-- CL 38403 -->
On Windows, Go no longer forces the system timer to run at high
resolution when the program is idle.
This should reduce the impact of Go programs on battery life.
</p>
<p><!-- CL 29341 -->
On FreeBSD, <code>GOMAXPROCS</code> and
<a href="/pkg/runtime/#NumCPU"><code>runtime.NumCPU</code></a>
are now based on the process' CPU mask, rather than the total
number of CPUs.
</p>
<p><!-- CL 43641 -->
The runtime has preliminary support for Android O.
</p>
</dl><!-- runtime -->
<dl id="runtime/pprof"><dt><a href="/pkg/runtime/pprof/">runtime/pprof</a></dt>
<dd>
<p><!-- CL 34198 -->
TODO: <a href="https://golang.org/cl/34198">https://golang.org/cl/34198</a>: add definitions of profile label types
</p>
</dl><!-- runtime/pprof -->
<dl id="runtime/debug"><dt><a href="/pkg/runtime/debug/">runtime/debug</a></dt>
<dd>
<p><!-- CL 34013 -->
Calling
<a href="/pkg/runtime/debug/#SetGCPercent"><code>SetGCPercent</code></a>
with a negative value no longer runs an immediate garbage collection.
</p>
</dl><!-- runtime/debug -->
<dl id="runtime/trace"><dt><a href="/pkg/runtime/trace/">runtime/trace</a></dt>
<dd>
<p><!-- CL 36015 -->
The execution trace now displays mark assist events, which
indicate when an application goroutine is forced to assist
garbage collection because it is allocating too quickly.
</p>
<p><!-- CL 40810 -->
"Sweep" events now encompass the entire process of finding free
space for an allocation, rather than recording each individual
span that is swept.
This reduces allocation latency when tracing allocation-heavy
programs.
The sweep event shows how many bytes were swept and how many
were reclaimed.
</p>
</dl><!-- runtime/trace -->
<dl id="sync"><dt><a href="/pkg/sync/">sync</a></dt>
<dd>
<p><!-- CL 34310 -->
<a href="/pkg/sync/#Mutex"><code>Mutex</code></a> is now more fair.
</p>
</dl><!-- sync -->
<dl id="syscall"><dt><a href="/pkg/syscall/">syscall</a></dt>
<dd>
<p><!-- CL 36697 -->
The new field
<a href="/pkg/syscall/#Credential.NoSetGroups"><code>Credential.NoSetGroups</code></a>
controls whether Unix systems make a <code>setgroups</code> system call
to set supplementary groups when starting a new process.
</p>
<p><!-- CL 37439 -->
On 64-bit x86 Linux, process creation latency has been optimized with
use of <code>CLONE_VFORK</code> and <code>CLONE_VM</code>.
</p>
<p><!-- CL 37913 -->
The new
<a href="/pkg/syscall/#Conn"><code>Conn</code></a>
interface describes some types in the
<a href="/pkg/net/"><code>net</code></a>
package that can provide access to their underlying file descriptor
using the new
<a href="/pkg/syscall/#RawConn"><code>RawConn</code></a>
interface.
</p>
</dl><!-- syscall -->
<dl id="testing/quick"><dt><a href="/pkg/testing/quick/">testing/quick</a></dt>
<dd>
<p><!-- CL 39152 -->
The package now chooses values in the full range when
generating <code>int64</code> and <code>uint64</code> random
numbers; in earlier releases generated values were always
limited to the [-2<sup>62</sup>, 2<sup>62</sup>) range.
</p>
</dl><!-- testing/quick -->
<dl id="text/template"><dt><a href="/pkg/text/template/">text/template</a></dt>
<dd>
<p><!-- CL 38420 -->
The handling of empty blocks, which was broken by a Go 1.8
change that made the result dependent on the order of templates,
has been fixed, restoring the old Go 1.7 behavior.
</p>
</dl><!-- text/template -->
<dl id="time"><dt><a href="/pkg/time/">time</a></dt>
<dd>
<p><!-- CL 36615 -->
The new methods
<a href="/pkg/time/#Duration.Round"><code>Duration.Round</code></a>
and
<a href="/pkg/time/#Duration.Truncate"><code>Duration.Truncate</code></a>
handle rounding and truncating durations to multiples of a given duration.
</p>
<p><!-- CL 35710 -->
Retrieving the time and sleeping now work correctly under Wine.
</p>
<p>
If a <code>Time</code> value has a monotonic clock reading, its
string representation (as returned by <code>String</code>) now includes a
final field <code>"m=±value"</code>, where <code>value</code> is the
monotonic clock reading formatted as a decimal number of seconds.
</p>
<p><!-- CL 44832 -->
The included <code>tzdata</code> timezone database has been
updated to version 2017b. As always, it is only used if the
system does not already have the database available.
</p>
</dl><!-- time -->

View File

@@ -1140,7 +1140,7 @@ program is one tool to help automate this process.
</p>
<p>
The Go 1.5 release added a facility to the
The Go 1.5 release includes an experimental facility to the
<a href="https://golang.org/cmd/go">go</a> command
that makes it easier to manage external dependencies by "vendoring"
them into a special directory near the package that depends upon them.
@@ -1148,13 +1148,6 @@ See the <a href="https://golang.org/s/go15vendor">design
document</a> for details.
</p>
<p>
Work is underway on an experimental package management tool,
<a href="https://github.com/golang/dep"><code>dep</code></a>, to learn
more about how tooling can help package management. More information can be found in
<a href="https://github.com/golang/dep/blob/master/FAQ.md">the <code>dep</code> FAQ</a>.
</p>
<h2 id="Pointers">Pointers and Allocation</h2>
<h3 id="pass_by_value">

View File

@@ -1,6 +1,6 @@
<!--{
"Title": "The Go Programming Language Specification",
"Subtitle": "Version of June 7, 2017",
"Subtitle": "Version of January 31, 2017",
"Path": "/ref/spec"
}-->
@@ -154,7 +154,7 @@ Any other comment acts like a newline.
<p>
Tokens form the vocabulary of the Go language.
There are four classes: <i>identifiers</i>, <i>keywords</i>, <i>operators
and punctuation</i>, and <i>literals</i>. <i>White space</i>, formed from
and delimiters</i>, and <i>literals</i>. <i>White space</i>, formed from
spaces (U+0020), horizontal tabs (U+0009),
carriage returns (U+000D), and newlines (U+000A),
is ignored except as it separates tokens
@@ -197,7 +197,7 @@ into the token stream immediately after a line's final token if that token is
<code>return</code>
</li>
<li>one of the <a href="#Operators_and_punctuation">operators and punctuation</a>
<li>one of the <a href="#Operators_and_Delimiters">operators and delimiters</a>
<code>++</code>,
<code>--</code>,
<code>)</code>,
@@ -254,11 +254,10 @@ const fallthrough if range type
continue for import return var
</pre>
<h3 id="Operators_and_punctuation">Operators and punctuation</h3>
<h3 id="Operators_and_Delimiters">Operators and Delimiters</h3>
<p>
The following character sequences represent <a href="#Operators">operators</a>
(including <a href="#assign_op">assignment operators</a>) and punctuation:
The following character sequences represent <a href="#Operators">operators</a>, delimiters, and other special tokens:
</p>
<pre class="grammar">
+ &amp; += &amp;= &amp;&amp; == != ( )
@@ -686,9 +685,11 @@ If a variable has not yet been assigned a value, its value is the
<h2 id="Types">Types</h2>
<p>
A type determines a set of values together with operations and methods specific
to those values. A type may be denoted by a <i>type name</i>, if it has one,
or specified using a <i>type literal</i>, which composes a type from existing types.
A type determines the set of values and operations specific to values of that
type. Types may be <i>named</i> or <i>unnamed</i>. Named types are specified
by a (possibly <a href="#Qualified_identifiers">qualified</a>)
<a href="#Type_declarations"><i>type name</i></a>; unnamed types are specified
using a <i>type literal</i>, which composes a new type from existing types.
</p>
<pre class="ebnf">
@@ -701,7 +702,6 @@ TypeLit = ArrayType | StructType | PointerType | FunctionType | InterfaceType
<p>
Named instances of the boolean, numeric, and string types are
<a href="#Predeclared_identifiers">predeclared</a>.
Other named types are introduced with <a href="#Type_declarations">type declarations</a>.
<i>Composite types</i>&mdash;array, struct, pointer, function,
interface, slice, map, and channel types&mdash;may be constructed using
type literals.
@@ -717,23 +717,16 @@ is the underlying type of the type to which <code>T</code> refers in its
</p>
<pre>
type (
A1 = string
A2 = A1
)
type (
B1 string
B2 B1
B3 []B1
B4 B3
)
type T1 string
type T2 T1
type T3 []T1
type T4 T3
</pre>
<p>
The underlying type of <code>string</code>, <code>A1</code>, <code>A2</code>, <code>B1</code>,
and <code>B2</code> is <code>string</code>.
The underlying type of <code>[]B1</code>, <code>B3</code>, and <code>B4</code> is <code>[]B1</code>.
The underlying type of <code>string</code>, <code>T1</code>, and <code>T2</code>
is <code>string</code>. The underlying type of <code>[]T1</code>, <code>T3</code>,
and <code>T4</code> is <code>[]T1</code>.
</p>
<h3 id="Method_sets">Method sets</h3>
@@ -1424,10 +1417,11 @@ Two types are either <i>identical</i> or <i>different</i>.
</p>
<p>
A <a href="#Type_definitions">defined type</a> is always different from any other type.
Otherwise, two types are identical if their <a href="#Types">underlying</a> type literals are
structurally equivalent; that is, they have the same literal structure and corresponding
components have identical types. In detail:
Two <a href="#Types">named types</a> are identical if their type names originate in the same
<a href="#Type_declarations">TypeSpec</a>.
A named and an <a href="#Types">unnamed type</a> are always different. Two unnamed types are identical
if the corresponding type literals are identical, that is, if they have the same
literal structure and corresponding components have identical types. In detail:
</p>
<ul>
@@ -1466,24 +1460,13 @@ Given the declarations
<pre>
type (
A0 = []string
A1 = A0
A2 = struct{ a, b int }
A3 = int
A4 = func(A3, float64) *A0
A5 = func(x int, _ float64) *[]string
T0 []string
T1 []string
T2 struct{ a, b int }
T3 struct{ a, c int }
T4 func(int, float64) *T0
T5 func(x int, y float64) *[]string
)
type (
B0 A0
B1 []string
B2 struct{ a, b int }
B3 struct{ a, c int }
B4 func(int, float64) *B0
B5 func(x int, y float64) *A1
)
type C0 = B0
</pre>
<p>
@@ -1491,22 +1474,17 @@ these types are identical:
</p>
<pre>
A0, A1, and []string
A2 and struct{ a, b int }
A3 and int
A4, func(int, float64) *[]string, and A5
B0, B0, and C0
T0 and T0
[]int and []int
struct{ a, b *T5 } and struct{ a, b *T5 }
func(x int, y float64) *[]string, func(int, float64) (result *[]string), and A5
func(x int, y float64) *[]string and func(int, float64) (result *[]string)
</pre>
<p>
<code>B0</code> and <code>B1</code> are different because they are new types
created by distinct <a href="#Type_definitions">type definitions</a>;
<code>func(int, float64) *B0</code> and <code>func(x int, y float64) *[]string</code>
are different because <code>B0</code> is different from <code>[]string</code>.
<code>T0</code> and <code>T1</code> are different because they are named types
with distinct declarations; <code>func(int, float64) *T0</code> and
<code>func(x int, y float64) *[]string</code> are different because <code>T0</code>
is different from <code>[]string</code>.
</p>
@@ -1524,7 +1502,7 @@ A value <code>x</code> is <i>assignable</i> to a <a href="#Variables">variable</
<li>
<code>x</code>'s type <code>V</code> and <code>T</code> have identical
<a href="#Types">underlying types</a> and at least one of <code>V</code>
or <code>T</code> is not a <a href="#Type_definitions">defined</a> type.
or <code>T</code> is not a <a href="#Types">named type</a>.
</li>
<li>
<code>T</code> is an interface type and
@@ -1533,7 +1511,7 @@ or <code>T</code> is not a <a href="#Type_definitions">defined</a> type.
<li>
<code>x</code> is a bidirectional channel value, <code>T</code> is a channel type,
<code>x</code>'s type <code>V</code> and <code>T</code> have identical element types,
and at least one of <code>V</code> or <code>T</code> is not a defined type.
and at least one of <code>V</code> or <code>T</code> is not a named type.
</li>
<li>
<code>x</code> is the predeclared identifier <code>nil</code> and <code>T</code>
@@ -1862,60 +1840,23 @@ last non-empty expression list.
<h3 id="Type_declarations">Type declarations</h3>
<p>
A type declaration binds an identifier, the <i>type name</i>, to a <a href="#Types">type</a>.
Type declarations come in two forms: alias declarations and type definitions.
<p>
<pre class="ebnf">
TypeDecl = "type" ( TypeSpec | "(" { TypeSpec ";" } ")" ) .
TypeSpec = AliasDecl | TypeDef .
</pre>
<h4 id="Alias_declarations">Alias declarations</h4>
<p>
An alias declaration binds an identifier to the given type.
A type declaration binds an identifier, the <i>type name</i>, to a new type
that has the same <a href="#Types">underlying type</a> as an existing type,
and operations defined for the existing type are also defined for the new type.
The new type is <a href="#Type_identity">different</a> from the existing type.
</p>
<pre class="ebnf">
AliasDecl = identifier "=" Type .
TypeDecl = "type" ( TypeSpec | "(" { TypeSpec ";" } ")" ) .
TypeSpec = identifier Type .
</pre>
<p>
Within the <a href="#Declarations_and_scope">scope</a> of
the identifier, it serves as an <i>alias</i> for the type.
</p>
<pre>
type IntArray [16]int
type (
nodeList = []*Node // nodeList and []*Node are identical types
Polar = polar // Polar and polar denote identical types
)
</pre>
<h4 id="Type_definitions">Type definitions</h4>
<p>
A type definition creates a new, distinct type with the same
<a href="#Types">underlying type</a> and operations as the given type,
and binds an identifier to it.
</p>
<pre class="ebnf">
TypeDef = identifier Type .
</pre>
<p>
The new type is called a <i>defined type</i>.
It is <a href="#Type_identity">different</a> from any other type,
including the type it is created from.
</p>
<pre>
type (
Point struct{ x, y float64 } // Point and struct{ x, y float64 } are different types
polar Point // polar and Point denote different types
Point struct{ x, y float64 }
Polar Point
)
type TreeNode struct {
@@ -1931,9 +1872,8 @@ type Block interface {
</pre>
<p>
A defined type may have <a href="#Method_declarations">methods</a> associated with it.
It does not inherit any methods bound to the given type,
but the <a href="#Method_sets">method set</a>
The declared type does not inherit any <a href="#Method_declarations">methods</a>
bound to the existing type, but the <a href="#Method_sets">method set</a>
of an interface type or of elements of a composite type remains unchanged:
</p>
@@ -1961,8 +1901,8 @@ type MyBlock Block
</pre>
<p>
Type definitions may be used to define different boolean, numeric,
or string types and associate methods with them:
A type declaration may be used to define a different boolean, numeric, or string
type and attach methods to it:
</p>
<pre>
@@ -1984,8 +1924,8 @@ func (tz TimeZone) String() string {
<h3 id="Variable_declarations">Variable declarations</h3>
<p>
A variable declaration creates one or more <a href="#Variables">variables</a>,
binds corresponding identifiers to them, and gives each a type and an initial value.
A variable declaration creates one or more variables, binds corresponding
identifiers to them, and gives each a type and an initial value.
</p>
<pre class="ebnf">
@@ -2143,8 +2083,8 @@ and associates the method with the receiver's <i>base type</i>.
</p>
<pre class="ebnf">
MethodDecl = "func" Receiver MethodName ( Function | Signature ) .
Receiver = Parameters .
MethodDecl = "func" Receiver MethodName ( Function | Signature ) .
Receiver = Parameters .
</pre>
<p>
@@ -2153,7 +2093,7 @@ name. That parameter section must declare a single non-variadic parameter, the r
Its type must be of the form <code>T</code> or <code>*T</code> (possibly using
parentheses) where <code>T</code> is a type name. The type denoted by <code>T</code> is called
the receiver <i>base type</i>; it must not be a pointer or interface type and
it must be <a href="#Type_definitions">defined</a> in the same package as the method.
it must be declared in the same package as the method.
The method is said to be <i>bound</i> to the base type and the method name
is visible only within <a href="#Selectors">selectors</a> for type <code>T</code>
or <code>*T</code>.
@@ -2295,8 +2235,7 @@ The key is interpreted as a field name for struct literals,
an index for array and slice literals, and a key for map literals.
For map literals, all elements must have a key. It is an error
to specify multiple elements with the same field name or
constant key value. For non-constant map keys, see the section on
<a href="#Order_of_evaluation">evaluation order</a>.
constant key value.
</p>
<p>
@@ -3384,7 +3323,7 @@ to the type of the other operand.
<p>
The right operand in a shift expression must have unsigned integer type
or be an untyped constant representable by a value of type <code>uint</code>.
or be an untyped constant that can be converted to unsigned integer type.
If the left operand of a non-constant shift expression is an untyped constant,
it is first converted to the type it would assume if the shift expression were
replaced by its left operand alone.
@@ -3582,33 +3521,6 @@ IEEE-754 standard; whether a <a href="#Run_time_panics">run-time panic</a>
occurs is implementation-specific.
</p>
<p>
An implementation may combine multiple floating-point operations into a single
fused operation, possibly across statements, and produce a result that differs
from the value obtained by executing and rounding the instructions individually.
A floating-point type <a href="#Conversions">conversion</a> explicitly rounds to
the precision of the target type, preventing fusion that would discard that rounding.
</p>
<p>
For instance, some architectures provide a "fused multiply and add" (FMA) instruction
that computes <code>x*y + z</code> without rounding the intermediate result <code>x*y</code>.
These examples show when a Go implementation can use that instruction:
</p>
<pre>
// FMA allowed for computing r, because x*y is not explicitly rounded:
r = x*y + z
r = z; r += x*y
t = x*y; r = t + z
*p = x*y; r = *p + z
r = x*y + float64(z)
// FMA disallowed for computing r, because it would omit rounding of x*y:
r = float64(x*y) + z
r = z; r += float64(x*y)
t = float64(x*y); r = t + z
</pre>
<h4 id="String_concatenation">String concatenation</h4>
@@ -3667,7 +3579,7 @@ These terms and the result of the comparisons are defined as follows:
</li>
<li>
Floating-point values are comparable and ordered,
Floating point values are comparable and ordered,
as defined by the IEEE-754 standard.
</li>
@@ -3937,8 +3849,7 @@ in any of these cases:
</li>
<li>
ignoring struct tags (see below),
<code>x</code>'s type and <code>T</code> are pointer types
that are not <a href="#Type_definitions">defined types</a>,
<code>x</code>'s type and <code>T</code> are unnamed pointer types
and their pointer base types have identical underlying types.
</li>
<li>
@@ -4523,8 +4434,8 @@ a[i] = 23
<p>
An <i>assignment operation</i> <code>x</code> <i>op</i><code>=</code>
<code>y</code> where <i>op</i> is a binary <a href="#Arithmetic_operators">arithmetic operator</a>
is equivalent to <code>x</code> <code>=</code> <code>x</code> <i>op</i>
<code>y</code> where <i>op</i> is a binary arithmetic operation is equivalent
to <code>x</code> <code>=</code> <code>x</code> <i>op</i>
<code>(y)</code> but evaluates <code>x</code>
only once. The <i>op</i><code>=</code> construct is a single token.
In assignment operations, both the left- and right-hand expression lists
@@ -5126,7 +5037,7 @@ function completes.
<pre>
go Server()
go func(ch chan&lt;- bool) { for { sleep(10); ch &lt;- true }} (c)
go func(ch chan&lt;- bool) { for { sleep(10); ch &lt;- true; }} (c)
</pre>
@@ -5672,7 +5583,7 @@ make(T, n) slice slice of type T with length n and capacity n
make(T, n, m) slice slice of type T with length n and capacity m
make(T) map map of type T
make(T, n) map map of type T with initial space for approximately n elements
make(T, n) map map of type T with initial space for n elements
make(T) channel unbuffered channel of type T
make(T, n) channel buffered channel of type T, buffer size n
@@ -5695,15 +5606,9 @@ s := make([]int, 1e3) // slice with len(s) == cap(s) == 1000
s := make([]int, 1&lt;&lt;63) // illegal: len(s) is not representable by a value of type int
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 approximately 100 elements
m := make(map[string]int, 100) // map with initial space for 100 elements
</pre>
<p>
Calling <code>make</code> with a map type and size hint <code>n</code> will
create a map with initial space to hold <code>n</code> map elements.
The precise behavior is implementation-dependent.
</p>
<h3 id="Appending_and_copying_slices">Appending to and copying slices</h3>
@@ -5965,11 +5870,6 @@ print prints all arguments; formatting of arguments is implementation-speci
println like print but prints spaces between arguments and a newline at the end
</pre>
<p>
Implementation restriction: <code>print</code> and <code>println</code> need not
accept arbitrary argument types, but printing of boolean, numeric, and string
<a href="#Types">types</a> must be supported.
</p>
<h2 id="Packages">Packages</h2>
@@ -6431,7 +6331,7 @@ func Sizeof(variable ArbitraryType) uintptr
A <code>Pointer</code> is a <a href="#Pointer_types">pointer type</a> but a <code>Pointer</code>
value may not be <a href="#Address_operators">dereferenced</a>.
Any pointer or value of <a href="#Types">underlying type</a> <code>uintptr</code> can be converted to
a type of underlying type <code>Pointer</code> and vice versa.
a <code>Pointer</code> type and vice versa.
The effect of converting between <code>Pointer</code> and <code>uintptr</code> is implementation-defined.
</p>
@@ -6509,7 +6409,7 @@ The following minimal alignment properties are guaranteed:
</li>
<li>For a variable <code>x</code> of array type: <code>unsafe.Alignof(x)</code> is the same as
the alignment of a variable of the array's element type.
<code>unsafe.Alignof(x[0])</code>, but at least 1.
</li>
</ol>

View File

@@ -59,12 +59,6 @@ The <a href="https://reddit.com/r/golang">golang sub-Reddit</a> is a place
for Go news and discussion.
</p>
<h3 id="gotime"><a href="https://changelog.com/gotime">Go Time Podcast</a></h3>
<p>
The <a href="https://changelog.com/gotime">Go Time podcast</a> is a panel of Go experts and special guests
discussing the Go programming language, the community, and everything in between.
</p>
<h2 id="community">Community resources</h2>
<h3 id="go_user_groups"><a href="/wiki/GoUserGroups">Go User Groups</a></h3>

View File

@@ -143,7 +143,7 @@ packaged Go distribution.
<p>
To build a bootstrap tool chain from source, use
either the git branch <code>release-branch.go1.4</code> or
<a href="https://storage.googleapis.com/golang/go1.4-bootstrap-20170531.tar.gz">go1.4-bootstrap-20170531.tar.gz</a>,
<a href="https://storage.googleapis.com/golang/go1.4-bootstrap-20161024.tar.gz">go1.4-bootstrap-20161024.tar.gz</a>,
which contains the Go 1.4 source code plus accumulated fixes
to keep the tools running on newer operating systems.
(Go 1.4 was the last distribution in which the tool chain was written in C.)

View File

@@ -222,7 +222,8 @@ and building a simple program, as follows.
Create your <a href="code.html#Workspaces">workspace</a> directory,
<code class="testUnix">$HOME/go</code><code class="testWindows">%USERPROFILE%\go</code>.
(If you'd like to use a different directory,
you will need to <a href="https://golang.org/wiki/SettingGOPATH">set the <code>GOPATH</code> environment variable</a>.)
you will need to set the <code>GOPATH</code> environment variable;
see <a href="code.html#Workspaces">How to Write Go Code</a> for details.)
</p>
<p>

View File

@@ -20,7 +20,7 @@ This mail is delivered to a small security team.
Your email will be acknowledged within 24 hours, and you'll receive a more
detailed response to your email within 72 hours indicating the next steps in
handling your report.
For critical problems, you can encrypt your report using our PGP key (listed below).
If you would like, you can encrypt your report using our PGP key (listed below).
</p>
<p>
@@ -118,12 +118,6 @@ If you have any suggestions to improve this policy, please send an email to
<h3>PGP Key for <a href="mailto:security@golang.org">security@golang.org</a></h3>
<p>
We accept PGP-encrypted email, but the majority of the security team
are not regular PGP users so it's somewhat inconvenient. Please only
use PGP for critical security reports.
</p>
<pre>
-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: GPGTools - https://gpgtools.org

View File

@@ -8,8 +8,8 @@
# Consult http://www.iana.org/time-zones for the latest versions.
# Versions to use.
CODE=2017b
DATA=2017b
CODE=2016j
DATA=2016j
set -e
rm -rf work
@@ -42,7 +42,7 @@ zip -0 -r ../../zoneinfo.zip *
cd ../..
echo
if [ "$1" = "-work" ]; then
if [ "$1" == "-work" ]; then
echo Left workspace behind in work/.
else
rm -rf work

Binary file not shown.

View File

@@ -24,16 +24,7 @@ func run(args ...string) string {
buf := new(bytes.Buffer)
cmd := exec.Command("adb", args...)
cmd.Stdout = io.MultiWriter(os.Stdout, buf)
// If the adb subprocess somehow hangs, go test will kill this wrapper
// and wait for our os.Stderr (and os.Stdout) to close as a result.
// However, if the os.Stderr (or os.Stdout) file descriptors are
// passed on, the hanging adb subprocess will hold them open and
// go test will hang forever.
//
// Avoid that by wrapping stderr, breaking the short circuit and
// forcing cmd.Run to use another pipe and goroutine to pass
// along stderr from adb.
cmd.Stderr = struct{ io.Writer }{os.Stderr}
cmd.Stderr = os.Stderr
log.Printf("adb %s", strings.Join(args, " "))
err := cmd.Run()
if err != nil {

View File

@@ -1,18 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Issue 18452: show pos info in undefined name errors
package p
import (
"C"
"fmt"
)
func a() {
fmt.Println("Hello, world!")
C.function_that_does_not_exist() // line 16
C.pi // line 17
}

View File

@@ -1,7 +0,0 @@
package main
import "C"
func main() {
_ = C.malloc // ERROR HERE
}

View File

@@ -17,7 +17,7 @@ check() {
expect() {
file=$1
shift
if go build -gcflags=-C $file >errs 2>&1; then
if go build $file >errs 2>&1; then
echo 1>&2 misc/cgo/errors/test.bash: BUG: expected cgo to fail on $file but it succeeded
exit 1
fi
@@ -47,8 +47,6 @@ expect issue13635.go C.uchar C.schar C.ushort C.uint C.ulong C.longlong C.ulongl
check issue13830.go
check issue16116.go
check issue16591.go
check issue18889.go
expect issue18452.go issue18452.go:16 issue18452.go:17
if ! go build issue14669.go; then
exit 1

View File

@@ -12,7 +12,7 @@ FC=$1
goos=$(go env GOOS)
libext="so"
if [ "$goos" = "darwin" ]; then
if [ "$goos" == "darwin" ]; then
libext="dylib"
fi

View File

@@ -76,8 +76,5 @@ func TestThreadLock(t *testing.T) { testThreadLockFunc(t) }
func TestCheckConst(t *testing.T) { testCheckConst(t) }
func Test17537(t *testing.T) { test17537(t) }
func Test18126(t *testing.T) { test18126(t) }
func Test20369(t *testing.T) { test20369(t) }
func Test18720(t *testing.T) { test18720(t) }
func Test20266(t *testing.T) { test20266(t) }
func BenchmarkCgoCall(b *testing.B) { benchCgoCall(b) }

View File

@@ -1,28 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package cgotest
/*
#define HELLO "hello"
#define WORLD "world"
#define HELLO_WORLD HELLO "\000" WORLD
struct foo { char c; };
#define SIZE_OF(x) sizeof(x)
#define SIZE_OF_FOO SIZE_OF(struct foo)
*/
import "C"
import "testing"
func test18720(t *testing.T) {
if C.HELLO_WORLD != "hello\000world" {
t.Fatalf(`expected "hello\000world", but got %q`, C.HELLO_WORLD)
}
// Issue 20125.
if got, want := C.SIZE_OF_FOO, 1; got != want {
t.Errorf("C.SIZE_OF_FOO == %v, expected %v", got, want)
}
}

View File

@@ -1,21 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Issue 20266: use -I with a relative path.
package cgotest
/*
#cgo CFLAGS: -I issue20266 -Iissue20266 -Ddef20266
#include "issue20266.h"
*/
import "C"
import "testing"
func test20266(t *testing.T) {
if got, want := C.issue20266, 20266; got != want {
t.Errorf("got %d, want %d", got, want)
}
}

View File

@@ -1,9 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
#define issue20266 20266
#ifndef def20266
#error "expected def20266 to be defined"
#endif

View File

@@ -1,20 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package cgotest
/*
#define UINT64_MAX 18446744073709551615ULL
*/
import "C"
import (
"math"
"testing"
)
func test20369(t *testing.T) {
if C.UINT64_MAX != math.MaxUint64 {
t.Fatalf("got %v, want %v", uint64(C.UINT64_MAX), uint64(math.MaxUint64))
}
}

View File

@@ -74,15 +74,18 @@ func testNaming(t *testing.T) {
}
}
if c := C.myfloat_def; c != 1.5 {
t.Errorf("C.myint_def = %v, want 1.5", c)
}
{
const c = C.myfloat_def
if c != 1.5 {
t.Errorf("C.myint as const = %v, want 1.5", c)
// This would be nice, but it has never worked.
/*
if c := C.myfloat_def; c != 1.5 {
t.Errorf("C.myint_def = %v, want 1.5", c)
}
}
{
const c = C.myfloat_def
if c != 1.5 {
t.Errorf("C.myint as const = %v, want 1.5", c)
}
}
*/
if s := C.mystring_def; s != "hello" {
t.Errorf("C.mystring_def = %q, want %q", s, "hello")

View File

@@ -115,10 +115,8 @@ func init() {
func goEnv(key string) string {
out, err := exec.Command("go", "env", key).Output()
if err != nil {
fmt.Fprintf(os.Stderr, "go env %s failed:\n%s\n", key, err)
if ee, ok := err.(*exec.ExitError); ok {
fmt.Fprintf(os.Stderr, "%s", ee.Stderr)
}
fmt.Fprintf(os.Stderr, "go env %s failed:\n%s", key, err)
fmt.Fprintf(os.Stderr, "%s", err.(*exec.ExitError).Stderr)
os.Exit(2)
}
return strings.TrimSpace(string(out))
@@ -220,7 +218,15 @@ func TestEarlySignalHandler(t *testing.T) {
}
func TestSignalForwarding(t *testing.T) {
checkSignalForwardingTest(t)
switch GOOS {
case "darwin":
switch GOARCH {
case "arm", "arm64":
t.Skipf("skipping on %s/%s; see https://golang.org/issue/13701", GOOS, GOARCH)
}
case "windows":
t.Skip("skipping signal test on Windows")
}
defer func() {
os.Remove("libgo2.a")
@@ -245,19 +251,32 @@ func TestSignalForwarding(t *testing.T) {
cmd = exec.Command(bin[0], append(bin[1:], "1")...)
out, err := cmd.CombinedOutput()
t.Logf("%s", out)
expectSignal(t, err, syscall.SIGSEGV)
// Test SIGPIPE forwarding
cmd = exec.Command(bin[0], append(bin[1:], "3")...)
out, err = cmd.CombinedOutput()
t.Logf("%s", out)
expectSignal(t, err, syscall.SIGPIPE)
if err == nil {
t.Logf("%s", out)
t.Error("test program succeeded unexpectedly")
} else if ee, ok := err.(*exec.ExitError); !ok {
t.Logf("%s", out)
t.Errorf("error (%v) has type %T; expected exec.ExitError", err, err)
} else if ws, ok := ee.Sys().(syscall.WaitStatus); !ok {
t.Logf("%s", out)
t.Errorf("error.Sys (%v) has type %T; expected syscall.WaitStatus", ee.Sys(), ee.Sys())
} else if !ws.Signaled() || ws.Signal() != syscall.SIGSEGV {
t.Logf("%s", out)
t.Errorf("got %v; expected SIGSEGV", ee)
}
}
func TestSignalForwardingExternal(t *testing.T) {
checkSignalForwardingTest(t)
switch GOOS {
case "darwin":
switch GOARCH {
case "arm", "arm64":
t.Skipf("skipping on %s/%s; see https://golang.org/issue/13701", GOOS, GOARCH)
}
case "windows":
t.Skip("skipping signal test on Windows")
}
defer func() {
os.Remove("libgo2.a")
@@ -325,7 +344,14 @@ func TestSignalForwardingExternal(t *testing.T) {
continue
}
if expectSignal(t, err, syscall.SIGSEGV) {
if ee, ok := err.(*exec.ExitError); !ok {
t.Errorf("error (%v) has type %T; expected exec.ExitError", err, err)
} else if ws, ok := ee.Sys().(syscall.WaitStatus); !ok {
t.Errorf("error.Sys (%v) has type %T; expected syscall.WaitStatus", ee.Sys(), ee.Sys())
} else if !ws.Signaled() || ws.Signal() != syscall.SIGSEGV {
t.Errorf("got %v; expected SIGSEGV", ee)
} else {
// We got the error we expected.
return
}
}
@@ -333,38 +359,6 @@ func TestSignalForwardingExternal(t *testing.T) {
t.Errorf("program succeeded unexpectedly %d times", tries)
}
// checkSignalForwardingTest calls t.Skip if the SignalForwarding test
// doesn't work on this platform.
func checkSignalForwardingTest(t *testing.T) {
switch GOOS {
case "darwin":
switch GOARCH {
case "arm", "arm64":
t.Skipf("skipping on %s/%s; see https://golang.org/issue/13701", GOOS, GOARCH)
}
case "windows":
t.Skip("skipping signal test on Windows")
}
}
// expectSignal checks that err, the exit status of a test program,
// shows a failure due to a specific signal. Returns whether we found
// the expected signal.
func expectSignal(t *testing.T, err error, sig syscall.Signal) bool {
if err == nil {
t.Error("test program succeeded unexpectedly")
} else if ee, ok := err.(*exec.ExitError); !ok {
t.Errorf("error (%v) has type %T; expected exec.ExitError", err, err)
} else if ws, ok := ee.Sys().(syscall.WaitStatus); !ok {
t.Errorf("error.Sys (%v) has type %T; expected syscall.WaitStatus", ee.Sys(), ee.Sys())
} else if !ws.Signaled() || ws.Signal() != sig {
t.Errorf("got %v; expected signal %v", ee, sig)
} else {
return true
}
return false
}
func TestOsSignal(t *testing.T) {
switch GOOS {
case "windows":
@@ -544,79 +538,3 @@ func hasDynTag(t *testing.T, f *elf.File, tag elf.DynTag) bool {
}
return false
}
func TestSIGPROF(t *testing.T) {
switch GOOS {
case "windows", "plan9":
t.Skipf("skipping SIGPROF test on %s", GOOS)
}
t.Parallel()
defer func() {
os.Remove("testp6" + exeSuffix)
os.Remove("libgo6.a")
os.Remove("libgo6.h")
}()
cmd := exec.Command("go", "build", "-buildmode=c-archive", "-o", "libgo6.a", "libgo6")
cmd.Env = gopathEnv
if out, err := cmd.CombinedOutput(); err != nil {
t.Logf("%s", out)
t.Fatal(err)
}
ccArgs := append(cc, "-o", "testp6"+exeSuffix, "main6.c", "libgo6.a")
if out, err := exec.Command(ccArgs[0], ccArgs[1:]...).CombinedOutput(); err != nil {
t.Logf("%s", out)
t.Fatal(err)
}
argv := cmdToRun("./testp6")
cmd = exec.Command(argv[0], argv[1:]...)
if out, err := cmd.CombinedOutput(); err != nil {
t.Logf("%s", out)
t.Fatal(err)
}
}
// TestCompileWithoutShared tests that if we compile code without the
// -shared option, we can put it into an archive. When we use the go
// tool with -buildmode=c-archive, it passes -shared to the compiler,
// so we override that. The go tool doesn't work this way, but Bazel
// will likely do it in the future. And it ought to work. This test
// was added because at one time it did not work on PPC GNU/Linux.
func TestCompileWithoutShared(t *testing.T) {
// For simplicity, reuse the signal forwarding test.
checkSignalForwardingTest(t)
defer func() {
os.Remove("libgo2.a")
os.Remove("libgo2.h")
}()
cmd := exec.Command("go", "build", "-buildmode=c-archive", "-gcflags=-shared=false", "-o", "libgo2.a", "libgo2")
cmd.Env = gopathEnv
t.Log(cmd.Args)
out, err := cmd.CombinedOutput()
t.Logf("%s", out)
if err != nil {
t.Fatal(err)
}
exe := "./testnoshared" + exeSuffix
ccArgs := append(cc, "-o", exe, "main5.c", "libgo2.a")
t.Log(ccArgs)
out, err = exec.Command(ccArgs[0], ccArgs[1:]...).CombinedOutput()
t.Logf("%s", out)
if err != nil {
t.Fatal(err)
}
defer os.Remove(exe)
binArgs := append(cmdToRun(exe), "3")
t.Log(binArgs)
out, err = exec.Command(binArgs[0], binArgs[1:]...).CombinedOutput()
t.Logf("%s", out)
expectSignal(t, err, syscall.SIGPIPE)
}

View File

@@ -17,7 +17,6 @@
#include <unistd.h>
#include <sched.h>
#include <time.h>
#include <errno.h>
#include "libgo2.h"
@@ -27,7 +26,6 @@ static void die(const char* msg) {
}
static volatile sig_atomic_t sigioSeen;
static volatile sig_atomic_t sigpipeSeen;
// Use up some stack space.
static void recur(int i, char *p) {
@@ -39,10 +37,6 @@ static void recur(int i, char *p) {
}
}
static void pipeHandler(int signo, siginfo_t* info, void* ctxt) {
sigpipeSeen = 1;
}
// Signal handler that uses up more stack space than a goroutine will have.
static void ioHandler(int signo, siginfo_t* info, void* ctxt) {
char a[1024];
@@ -112,10 +106,6 @@ static void init() {
die("sigaction");
}
sa.sa_sigaction = pipeHandler;
if (sigaction(SIGPIPE, &sa, NULL) < 0) {
die("sigaction");
}
}
int main(int argc, char** argv) {
@@ -177,30 +167,7 @@ int main(int argc, char** argv) {
nanosleep(&ts, NULL);
i++;
if (i > 5000) {
fprintf(stderr, "looping too long waiting for SIGIO\n");
exit(EXIT_FAILURE);
}
}
if (verbose) {
printf("provoking SIGPIPE\n");
}
GoRaiseSIGPIPE();
if (verbose) {
printf("waiting for sigpipeSeen\n");
}
// Wait until the signal has been delivered.
i = 0;
while (!sigpipeSeen) {
ts.tv_sec = 0;
ts.tv_nsec = 1000000;
nanosleep(&ts, NULL);
i++;
if (i > 5000) {
fprintf(stderr, "looping too long waiting for SIGPIPE\n");
fprintf(stderr, "looping too long waiting for signal\n");
exit(EXIT_FAILURE);
}
}

View File

@@ -11,7 +11,6 @@
#include <string.h>
#include <time.h>
#include <sched.h>
#include <unistd.h>
#include "libgo3.h"
@@ -26,31 +25,6 @@ static void ioHandler(int signo, siginfo_t* info, void* ctxt) {
sigioSeen = 1;
}
// Set up the SIGPIPE signal handler in a high priority constructor, so
// that it is installed before the Go code starts.
static void pipeHandler(int signo, siginfo_t* info, void* ctxt) {
const char *s = "unexpected SIGPIPE\n";
write(2, s, strlen(s));
exit(EXIT_FAILURE);
}
static void init(void) __attribute__ ((constructor (200)));
static void init() {
struct sigaction sa;
memset(&sa, 0, sizeof sa);
sa.sa_sigaction = pipeHandler;
if (sigemptyset(&sa.sa_mask) < 0) {
die("sigemptyset");
}
sa.sa_flags = SA_SIGINFO;
if (sigaction(SIGPIPE, &sa, NULL) < 0) {
die("sigaction");
}
}
int main(int argc, char** argv) {
int verbose;
struct sigaction sa;
@@ -60,14 +34,6 @@ int main(int argc, char** argv) {
verbose = argc > 2;
setvbuf(stdout, NULL, _IONBF, 0);
if (verbose) {
printf("raising SIGPIPE\n");
}
// Test that the Go runtime handles SIGPIPE, even if we installed
// a non-default SIGPIPE handler before the runtime initializes.
ProvokeSIGPIPE();
if (verbose) {
printf("calling sigaction\n");
}

View File

@@ -68,24 +68,6 @@ int main(int argc, char** argv) {
break;
}
case 3: {
if (verbose) {
printf("attempting SIGPIPE\n");
}
int fd[2];
if (pipe(fd) != 0) {
printf("pipe(2) failed\n");
return 0;
}
// Close the reading end.
close(fd[0]);
// Expect that write(2) fails (EPIPE)
if (write(fd[1], "some data", 9) != -1) {
printf("write(2) unexpectedly succeeded\n");
return 0;
}
}
default:
printf("Unknown test: %d\n", test);
return 0;

View File

@@ -1,34 +0,0 @@
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Test that using the Go profiler in a C program does not crash.
#include <stddef.h>
#include <sys/time.h>
#include "libgo6.h"
int main(int argc, char **argv) {
struct timeval tvstart, tvnow;
int diff;
gettimeofday(&tvstart, NULL);
go_start_profile();
// Busy wait so we have something to profile.
// If we just sleep the profiling signal will never fire.
while (1) {
gettimeofday(&tvnow, NULL);
diff = (tvnow.tv_sec - tvstart.tv_sec) * 1000 * 1000 + (tvnow.tv_usec - tvstart.tv_usec);
// Profile frequency is 100Hz so we should definitely
// get a signal in 50 milliseconds.
if (diff > 50 * 1000)
break;
}
go_stop_profile();
return 0;
}

View File

@@ -4,30 +4,6 @@
package main
/*
#include <signal.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
// Raise SIGPIPE.
static void CRaiseSIGPIPE() {
int fds[2];
if (pipe(fds) == -1) {
perror("pipe");
exit(EXIT_FAILURE);
}
// Close the reader end
close(fds[0]);
// Write to the writer end to provoke a SIGPIPE
if (write(fds[1], "some data", 9) != -1) {
fprintf(stderr, "write to a closed pipe succeeded\n");
exit(EXIT_FAILURE);
}
close(fds[1]);
}
*/
import "C"
import (
@@ -70,11 +46,5 @@ func TestSEGV() {
func Noop() {
}
// Raise SIGPIPE.
//export GoRaiseSIGPIPE
func GoRaiseSIGPIPE() {
C.CRaiseSIGPIPE()
}
func main() {
}

View File

@@ -40,17 +40,5 @@ func SawSIGIO() C.int {
}
}
// ProvokeSIGPIPE provokes a kernel-initiated SIGPIPE.
//export ProvokeSIGPIPE
func ProvokeSIGPIPE() {
r, w, err := os.Pipe()
if err != nil {
panic(err)
}
r.Close()
defer w.Close()
w.Write([]byte("some data"))
}
func main() {
}

View File

@@ -1,25 +0,0 @@
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"io/ioutil"
"runtime/pprof"
)
import "C"
//export go_start_profile
func go_start_profile() {
pprof.StartCPUProfile(ioutil.Discard)
}
//export go_stop_profile
func go_stop_profile() {
pprof.StopCPUProfile()
}
func main() {
}

View File

@@ -12,7 +12,6 @@
// int8_t DidInitRun();
// int8_t DidMainRun();
// int32_t FromPkg();
// uint32_t Divu(uint32_t, uint32_t);
int main(void) {
int8_t ran_init = DidInitRun();
if (!ran_init) {
@@ -31,11 +30,6 @@ int main(void) {
fprintf(stderr, "ERROR: FromPkg=%d, want %d\n", from_pkg, 1024);
return 1;
}
uint32_t divu = Divu(2264, 31);
if (divu != 73) {
fprintf(stderr, "ERROR: Divu(2264, 31)=%d, want %d\n", divu, 73);
return 1;
}
// test.bash looks for "PASS" to ensure this program has reached the end.
printf("PASS\n");
return 0;

View File

@@ -8,5 +8,3 @@ import "C"
//export FromPkg
func FromPkg() int32 { return 1024 }
//export Divu
func Divu(a, b uint32) uint32 { return a / b }

View File

@@ -27,7 +27,7 @@ fi
# Directory where cgo headers and outputs will be installed.
# The installation directory format varies depending on the platform.
installdir=pkg/${goos}_${goarch}_testcshared_shared
if [ "${goos}" = "darwin" ]; then
if [ "${goos}" == "darwin" ]; then
installdir=pkg/${goos}_${goarch}_testcshared
fi
@@ -40,13 +40,13 @@ function cleanup() {
rm -f testp testp2 testp3 testp4 testp5
rm -rf pkg "${goroot}/${installdir}"
if [ "$goos" = "android" ]; then
if [ "$goos" == "android" ]; then
adb shell rm -rf "$androidpath"
fi
}
trap cleanup EXIT
if [ "$goos" = "android" ]; then
if [ "$goos" == "android" ]; then
adb shell mkdir -p "$androidpath"
fi
@@ -69,7 +69,7 @@ function run() {
function binpush() {
bin=${1}
if [ "$goos" = "android" ]; then
if [ "$goos" == "android" ]; then
adb push "$bin" "${androidpath}/${bin}" 2>/dev/null
fi
}
@@ -79,7 +79,7 @@ rm -rf pkg
suffix="-installsuffix testcshared"
libext="so"
if [ "$goos" = "darwin" ]; then
if [ "$goos" == "darwin" ]; then
libext="dylib"
fi
@@ -89,7 +89,7 @@ GOPATH=$(pwd) go install -buildmode=c-shared $suffix libgo
GOPATH=$(pwd) go build -buildmode=c-shared $suffix -o libgo.$libext src/libgo/libgo.go
binpush libgo.$libext
if [ "$goos" = "linux" ] || [ "$goos" = "android" ] ; then
if [ "$goos" == "linux" ] || [ "$goos" == "android" ] ; then
if readelf -d libgo.$libext | grep TEXTREL >/dev/null; then
echo "libgo.$libext has TEXTREL set"
exit 1
@@ -97,8 +97,8 @@ if [ "$goos" = "linux" ] || [ "$goos" = "android" ] ; then
fi
GOGCCFLAGS=$(go env GOGCCFLAGS)
if [ "$goos" = "android" ]; then
GOGCCFLAGS="${GOGCCFLAGS} -pie -fuse-ld=gold"
if [ "$goos" == "android" ]; then
GOGCCFLAGS="${GOGCCFLAGS} -pie"
fi
status=0
@@ -127,7 +127,7 @@ fi
GOPATH=$(pwd) go build -buildmode=c-shared $suffix -o libgo2.$libext libgo2
binpush libgo2.$libext
linkflags="-Wl,--no-as-needed"
if [ "$goos" = "darwin" ]; then
if [ "$goos" == "darwin" ]; then
linkflags=""
fi
$(go env CC) ${GOGCCFLAGS} -o testp2 main2.c $linkflags libgo2.$libext
@@ -139,7 +139,7 @@ if [ "$output" != "PASS" ]; then
fi
# test3: tests main.main is exported on android.
if [ "$goos" = "android" ]; then
if [ "$goos" == "android" ]; then
$(go env CC) ${GOGCCFLAGS} -o testp3 main3.c -ldl
binpush testp3
output=$(run ./testp ./libgo.so)

View File

@@ -1,23 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import "plugin"
func main() {
p, err := plugin.Open("plugin.so")
if err != nil {
panic(err)
}
sym, err := p.Lookup("Foo")
if err != nil {
panic(err)
}
f := sym.(func() int)
if f() != 42 {
panic("expected f() == 42")
}
}

View File

@@ -1,9 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
func Foo() int {
return 42
}

View File

@@ -16,7 +16,7 @@ goarch=$(go env GOARCH)
function cleanup() {
rm -f plugin*.so unnamed*.so iface*.so
rm -rf host pkg sub iface issue18676 issue19534
rm -rf host pkg sub iface issue18676
}
trap cleanup EXIT
@@ -44,9 +44,3 @@ LD_LIBRARY_PATH=$(pwd) ./iface
GOPATH=$(pwd) go build -buildmode=plugin -o plugin.so src/issue18676/plugin.go
GOPATH=$(pwd) go build -o issue18676 src/issue18676/main.go
timeout 10s ./issue18676
# Test for issue 19534 - that we can load a plugin built in a path with non-alpha
# characters
GOPATH=$(pwd) go build -buildmode=plugin -ldflags='-pluginpath=issue.19534' -o plugin.so src/issue19534/plugin.go
GOPATH=$(pwd) go build -o issue19534 src/issue19534/main.go
./issue19534

View File

@@ -9,15 +9,4 @@ import "C"
func FuncInt() int { return 1 }
// Add a recursive type to to check that type equality across plugins doesn't
// crash. See https://golang.org/issues/19258
func FuncRecursive() X { return X{} }
type Y struct {
X *X
}
type X struct {
Y Y
}
func main() {}

View File

@@ -9,13 +9,4 @@ import "C"
func FuncInt() int { return 2 }
func FuncRecursive() X { return X{} }
type Y struct {
X *X
}
type X struct {
Y Y
}
func main() {}

View File

@@ -72,12 +72,12 @@ testmsanshared() {
goos=$(go env GOOS)
suffix="-installsuffix testsanitizers"
libext="so"
if [ "$goos" = "darwin" ]; then
if [ "$goos" == "darwin" ]; then
libext="dylib"
fi
go build -msan -buildmode=c-shared $suffix -o ${TMPDIR}/libmsanshared.$libext msan_shared.go
echo 'int main() { return 0; }' > ${TMPDIR}/testmsanshared.c
echo 'int main() { return 0; }' > ${TMPDIR}/testmsanshared.c
$CC $(go env GOGCCFLAGS) -fsanitize=memory -o ${TMPDIR}/testmsanshared ${TMPDIR}/testmsanshared.c ${TMPDIR}/libmsanshared.$libext
if ! LD_LIBRARY_PATH=. ${TMPDIR}/testmsanshared; then
@@ -131,25 +131,6 @@ if test "$msan" = "yes"; then
testmsanshared
fi
testtsanshared() {
goos=$(go env GOOS)
suffix="-installsuffix tsan"
libext="so"
if [ "$goos" = "darwin" ]; then
libext="dylib"
fi
go build -buildmode=c-shared $suffix -o ${TMPDIR}/libtsanshared.$libext tsan_shared.go
echo 'int main() { return 0; }' > ${TMPDIR}/testtsanshared.c
$CC $(go env GOGCCFLAGS) -fsanitize=thread -o ${TMPDIR}/testtsanshared ${TMPDIR}/testtsanshared.c ${TMPDIR}/libtsanshared.$libext
if ! LD_LIBRARY_PATH=. ${TMPDIR}/testtsanshared; then
echo "FAIL: tsan_shared"
status=1
fi
rm -f ${TMPDIR}/{testtsanshared,testtsanshared.c,libtsanshared.$libext}
}
if test "$tsan" = "yes"; then
echo 'int main() { return 0; }' > ${TMPDIR}/testsanitizers$$.c
ok=yes
@@ -209,14 +190,14 @@ if test "$tsan" = "yes"; then
fi
if test "$ok" = "true"; then
# These tests require rebuilding os/user with -fsanitize=thread.
# This test requires rebuilding os/user with -fsanitize=thread.
testtsan tsan5.go "CGO_CFLAGS=-fsanitize=thread CGO_LDFLAGS=-fsanitize=thread" "-installsuffix=tsan"
testtsan tsan6.go "CGO_CFLAGS=-fsanitize=thread CGO_LDFLAGS=-fsanitize=thread" "-installsuffix=tsan"
testtsan tsan7.go "CGO_CFLAGS=-fsanitize=thread CGO_LDFLAGS=-fsanitize=thread" "-installsuffix=tsan"
testtsan tsan10.go "CGO_CFLAGS=-fsanitize=thread CGO_LDFLAGS=-fsanitize=thread" "-installsuffix=tsan"
testtsan tsan11.go "CGO_CFLAGS=-fsanitize=thread CGO_LDFLAGS=-fsanitize=thread" "-installsuffix=tsan"
testtsanshared
# This test requires rebuilding runtime/cgo with -fsanitize=thread.
testtsan tsan6.go "CGO_CFLAGS=-fsanitize=thread CGO_LDFLAGS=-fsanitize=thread" "-installsuffix=tsan"
# This test requires rebuilding runtime/cgo with -fsanitize=thread.
testtsan tsan7.go "CGO_CFLAGS=-fsanitize=thread CGO_LDFLAGS=-fsanitize=thread" "-installsuffix=tsan"
fi
fi

View File

@@ -1,31 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
// This program hung when run under the C/C++ ThreadSanitizer.
// TSAN defers asynchronous signals until the signaled thread calls into libc.
// Since the Go runtime makes direct futex syscalls, Go runtime threads could
// run for an arbitrarily long time without triggering the libc interceptors.
// See https://golang.org/issue/18717.
import (
"os"
"os/signal"
"syscall"
)
/*
#cgo CFLAGS: -g -fsanitize=thread
#cgo LDFLAGS: -g -fsanitize=thread
*/
import "C"
func main() {
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGUSR1)
defer signal.Stop(c)
syscall.Kill(syscall.Getpid(), syscall.SIGUSR1)
<-c
}

View File

@@ -1,55 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
// This program hung when run under the C/C++ ThreadSanitizer. TSAN defers
// asynchronous signals until the signaled thread calls into libc. The runtime's
// sysmon goroutine idles itself using direct usleep syscalls, so it could
// run for an arbitrarily long time without triggering the libc interceptors.
// See https://golang.org/issue/18717.
import (
"os"
"os/signal"
"syscall"
)
/*
#cgo CFLAGS: -g -fsanitize=thread
#cgo LDFLAGS: -g -fsanitize=thread
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static void raise_usr2(int signo) {
raise(SIGUSR2);
}
static void register_handler(int signo) {
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_ONSTACK;
sa.sa_handler = raise_usr2;
if (sigaction(SIGUSR1, &sa, NULL) != 0) {
perror("failed to register SIGUSR1 handler");
exit(EXIT_FAILURE);
}
}
*/
import "C"
func main() {
ch := make(chan os.Signal)
signal.Notify(ch, syscall.SIGUSR2)
C.register_handler(C.int(syscall.SIGUSR1))
syscall.Kill(syscall.Getpid(), syscall.SIGUSR1)
<-ch
}

View File

@@ -1,63 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
// This program failed with SIGSEGV when run under the C/C++ ThreadSanitizer.
// The Go runtime had re-registered the C handler with the wrong flags due to a
// typo, resulting in null pointers being passed for the info and context
// parameters to the handler.
/*
#cgo CFLAGS: -fsanitize=thread
#cgo LDFLAGS: -fsanitize=thread
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ucontext.h>
void check_params(int signo, siginfo_t *info, void *context) {
ucontext_t* uc = (ucontext_t*)(context);
if (info->si_signo != signo) {
fprintf(stderr, "info->si_signo does not match signo.\n");
abort();
}
if (uc->uc_stack.ss_size == 0) {
fprintf(stderr, "uc_stack has size 0.\n");
abort();
}
}
// Set up the signal handler in a high priority constructor, so
// that it is installed before the Go code starts.
static void register_handler(void) __attribute__ ((constructor (200)));
static void register_handler() {
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_SIGINFO;
sa.sa_sigaction = check_params;
if (sigaction(SIGUSR1, &sa, NULL) != 0) {
perror("failed to register SIGUSR1 handler");
exit(EXIT_FAILURE);
}
}
*/
import "C"
import "syscall"
func init() {
C.raise(C.int(syscall.SIGUSR1))
}
func main() {}

View File

@@ -10,6 +10,7 @@ import (
"debug/elf"
"encoding/binary"
"errors"
"flag"
"fmt"
"go/build"
"io"
@@ -165,6 +166,7 @@ func TestMain(m *testing.M) {
// That won't work if GOBIN is set.
os.Unsetenv("GOBIN")
flag.Parse()
exitCode, err := testMain(m)
if err != nil {
log.Fatal(err)
@@ -400,12 +402,6 @@ func TestTrivialExecutablePIE(t *testing.T) {
AssertHasRPath(t, "./trivial.pie", gorootInstallDir)
}
// Build a division test program and check it runs.
func TestDivisionExecutable(t *testing.T) {
goCmd(t, "install", "-linkshared", "division")
run(t, "division executable", "./bin/division")
}
// Build an executable that uses cgo linked against the shared runtime and check it
// runs.
func TestCgoExecutable(t *testing.T) {
@@ -763,13 +759,6 @@ func appendFile(path, content string) {
}
}
func writeFile(path, content string) {
err := ioutil.WriteFile(path, []byte(content), 0644)
if err != nil {
log.Fatalf("ioutil.WriteFile failed: %v", err)
}
}
func TestABIChecking(t *testing.T) {
goCmd(t, "install", "-buildmode=shared", "-linkshared", "depBase")
goCmd(t, "install", "-linkshared", "exe")
@@ -808,10 +797,9 @@ func TestABIChecking(t *testing.T) {
run(t, "rebuilt exe", "./bin/exe")
// If we make a change which does not break ABI (such as adding an unexported
// function) and rebuild libdepBase.so, exe still works, even if new function
// is in a file by itself.
// function) and rebuild libdepBase.so, exe still works.
resetFileStamps()
writeFile("src/depBase/dep2.go", "package depBase\nfunc noABIBreak() {}\n")
appendFile("src/depBase/dep.go", "func noABIBreak() {}\n")
goCmd(t, "install", "-buildmode=shared", "-linkshared", "depBase")
run(t, "after non-ABI breaking change", "./bin/exe")
}

View File

@@ -1,17 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
//go:noinline
func div(x, y uint32) uint32 {
return x / y
}
func main() {
a := div(97, 11)
if a != 8 {
panic("FAIL")
}
}

View File

@@ -23,37 +23,28 @@ import (
func main() {
devID := detectDevID()
fmt.Printf("export GOIOS_DEV_ID=%s\n", devID)
udid := detectUDID()
mps := detectMobileProvisionFiles(udid)
if len(mps) == 0 {
fail("did not find mobile provision matching device udid %s", udid)
}
mp := detectMobileProvisionFile(udid)
fmt.Println("Available provisioning profiles below.")
fmt.Println("NOTE: Any existing app on the device with the app id specified by GOIOS_APP_ID")
fmt.Println("will be overwritten when running Go programs.")
for _, mp := range mps {
fmt.Println()
fmt.Printf("export GOIOS_DEV_ID=%s\n", devID)
f, err := ioutil.TempFile("", "go_ios_detect_")
check(err)
fname := f.Name()
defer os.Remove(fname)
f, err := ioutil.TempFile("", "go_ios_detect_")
check(err)
fname := f.Name()
defer os.Remove(fname)
out := output(parseMobileProvision(mp))
_, err = f.Write(out)
check(err)
check(f.Close())
out := combinedOutput(parseMobileProvision(mp))
_, err = f.Write(out)
check(err)
check(f.Close())
appID, err := plistExtract(fname, "Entitlements:application-identifier")
check(err)
fmt.Printf("export GOIOS_APP_ID=%s\n", appID)
appID, err := plistExtract(fname, "ApplicationIdentifierPrefix:0")
check(err)
fmt.Printf("export GOIOS_APP_ID=%s\n", appID)
teamID, err := plistExtract(fname, "Entitlements:com.apple.developer.team-identifier")
check(err)
fmt.Printf("export GOIOS_TEAM_ID=%s\n", teamID)
}
teamID, err := plistExtract(fname, "Entitlements:com.apple.developer.team-identifier")
check(err)
fmt.Printf("export GOIOS_TEAM_ID=%s\n", teamID)
}
func detectDevID() string {
@@ -88,11 +79,10 @@ func detectUDID() []byte {
panic("unreachable")
}
func detectMobileProvisionFiles(udid []byte) []string {
func detectMobileProvisionFile(udid []byte) string {
cmd := exec.Command("mdfind", "-name", ".mobileprovision")
lines := getLines(cmd)
var files []string
for _, line := range lines {
if len(line) == 0 {
continue
@@ -100,11 +90,12 @@ func detectMobileProvisionFiles(udid []byte) []string {
xmlLines := getLines(parseMobileProvision(string(line)))
for _, xmlLine := range xmlLines {
if bytes.Contains(xmlLine, udid) {
files = append(files, string(line))
return string(line)
}
}
}
return files
fail("did not find mobile provision matching device udid %s", udid)
panic("ureachable")
}
func parseMobileProvision(fname string) *exec.Cmd {
@@ -120,12 +111,12 @@ func plistExtract(fname string, path string) ([]byte, error) {
}
func getLines(cmd *exec.Cmd) [][]byte {
out := output(cmd)
out := combinedOutput(cmd)
return bytes.Split(out, []byte("\n"))
}
func output(cmd *exec.Cmd) []byte {
out, err := cmd.Output()
func combinedOutput(cmd *exec.Cmd) []byte {
out, err := cmd.CombinedOutput()
if err != nil {
fmt.Println(strings.Join(cmd.Args, "\n"))
fmt.Fprintln(os.Stderr, err)

View File

@@ -45,10 +45,9 @@ var errRetry = errors.New("failed to start test harness (retry attempted)")
var tmpdir string
var (
devID string
appID string
teamID string
bundleID string
devID string
appID string
teamID string
)
// lock is a file lock to serialize iOS runs. It is global to avoid the
@@ -77,13 +76,6 @@ func main() {
// https://developer.apple.com/membercenter/index.action#accountSummary as Team ID.
teamID = getenv("GOIOS_TEAM_ID")
parts := strings.SplitN(appID, ".", 2)
// For compatibility with the old builders, use a fallback bundle ID
bundleID = "golang.gotest"
if len(parts) == 2 {
bundleID = parts[1]
}
var err error
tmpdir, err = ioutil.TempDir("", "go_darwin_arm_exec_")
if err != nil {
@@ -107,7 +99,7 @@ func main() {
// Approximately 1 in a 100 binaries fail to start. If it happens,
// try again. These failures happen for several reasons beyond
// our control, but all of them are safe to retry as they happen
// before lldb encounters the initial getwd breakpoint. As we
// before lldb encounters the initial SIGUSR2 stop. As we
// know the tests haven't started, we are not hiding flaky tests
// with this retry.
for i := 0; i < 5; i++ {
@@ -147,22 +139,22 @@ func run(bin string, args []string) (err error) {
return err
}
pkgpath, err := copyLocalData(appdir)
if err != nil {
return err
}
entitlementsPath := filepath.Join(tmpdir, "Entitlements.plist")
if err := ioutil.WriteFile(entitlementsPath, []byte(entitlementsPlist()), 0744); err != nil {
return err
}
if err := ioutil.WriteFile(filepath.Join(appdir, "Info.plist"), []byte(infoPlist(pkgpath)), 0744); err != nil {
if err := ioutil.WriteFile(filepath.Join(appdir, "Info.plist"), []byte(infoPlist), 0744); err != nil {
return err
}
if err := ioutil.WriteFile(filepath.Join(appdir, "ResourceRules.plist"), []byte(resourceRules), 0744); err != nil {
return err
}
pkgpath, err := copyLocalData(appdir)
if err != nil {
return err
}
cmd := exec.Command(
"codesign",
"-f",
@@ -212,6 +204,11 @@ func run(bin string, args []string) (err error) {
var opts options
opts, args = parseArgs(args)
// Pass the suffix for the current working directory as the
// first argument to the test. For iOS, cmd/go generates
// special handling of this argument.
args = append([]string{"cwdSuffix=" + pkgpath}, args...)
// ios-deploy invokes lldb to give us a shell session with the app.
s, err := newSession(appdir, args, opts)
if err != nil {
@@ -232,6 +229,7 @@ func run(bin string, args []string) (err error) {
s.do(`process handle SIGHUP --stop false --pass true --notify false`)
s.do(`process handle SIGPIPE --stop false --pass true --notify false`)
s.do(`process handle SIGUSR1 --stop false --pass true --notify false`)
s.do(`process handle SIGUSR2 --stop true --pass false --notify true`) // sent by test harness
s.do(`process handle SIGCONT --stop false --pass true --notify false`)
s.do(`process handle SIGSEGV --stop false --pass true --notify false`) // does not work
s.do(`process handle SIGBUS --stop false --pass true --notify false`) // does not work
@@ -246,7 +244,7 @@ func run(bin string, args []string) (err error) {
started = true
s.doCmd("run", "stop reason = signal SIGINT", 20*time.Second)
s.doCmd("run", "stop reason = signal SIGUSR2", 20*time.Second)
startTestsLen := s.out.Len()
fmt.Fprintln(s.in, `process continue`)
@@ -256,9 +254,7 @@ func run(bin string, args []string) (err error) {
return s.out.LastIndex([]byte("\nPASS\n")) > startTestsLen ||
s.out.LastIndex([]byte("\nPASS\r")) > startTestsLen ||
s.out.LastIndex([]byte("\n(lldb) PASS\n")) > startTestsLen ||
s.out.LastIndex([]byte("\n(lldb) PASS\r")) > startTestsLen ||
s.out.LastIndex([]byte("exited with status = 0 (0x00000000) \n")) > startTestsLen ||
s.out.LastIndex([]byte("exited with status = 0 (0x00000000) \r")) > startTestsLen
s.out.LastIndex([]byte("\n(lldb) PASS\r")) > startTestsLen
}
err = s.wait("test completion", passed, opts.timeout)
if passed(s.out) {
@@ -346,7 +342,7 @@ func newSession(appdir string, args []string, opts options) (*lldbSession, error
i2 := s.out.LastIndex([]byte(" connect"))
return i0 > 0 && i1 > 0 && i2 > 0
}
if err := s.wait("lldb start", cond, 15*time.Second); err != nil {
if err := s.wait("lldb start", cond, 10*time.Second); err != nil {
panic(waitPanic{err})
}
return s, nil
@@ -444,7 +440,7 @@ func parseArgs(binArgs []string) (opts options, remainingArgs []string) {
remainingArgs = append(remainingArgs, arg)
}
f := flag.NewFlagSet("", flag.ContinueOnError)
f.DurationVar(&opts.timeout, "test.timeout", 10*time.Minute, "")
f.DurationVar(&opts.timeout, "test.timeout", 0, "")
f.BoolVar(&opts.lldb, "lldb", false, "")
f.Parse(flagArgs)
return opts, remainingArgs
@@ -517,33 +513,18 @@ func copyLocalData(dstbase string) (pkgpath string, err error) {
}
}
// Copy timezone file.
//
// Apps have the zoneinfo.zip in the root of their app bundle,
// read by the time package as the working directory at initialization.
if underGoRoot {
// Copy timezone file.
//
// Typical apps have the zoneinfo.zip in the root of their app bundle,
// read by the time package as the working directory at initialization.
// As we move the working directory to the GOROOT pkg directory, we
// install the zoneinfo.zip file in the pkgpath.
err := cp(
filepath.Join(dstbase, pkgpath),
dstbase,
filepath.Join(cwd, "lib", "time", "zoneinfo.zip"),
)
if err != nil {
return "", err
}
// Copy src/runtime/textflag.h for (at least) Test386EndToEnd in
// cmd/asm/internal/asm.
runtimePath := filepath.Join(dstbase, "src", "runtime")
if err := os.MkdirAll(runtimePath, 0755); err != nil {
return "", err
}
err = cp(
filepath.Join(runtimePath, "textflag.h"),
filepath.Join(cwd, "src", "runtime", "textflag.h"),
)
if err != nil {
return "", err
}
}
return finalPkgpath, nil
@@ -581,8 +562,7 @@ func subdir() (pkgpath string, underGoRoot bool, err error) {
)
}
func infoPlist(pkgpath string) string {
return `<?xml version="1.0" encoding="UTF-8"?>
const infoPlist = `<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
@@ -590,15 +570,13 @@ func infoPlist(pkgpath string) string {
<key>CFBundleSupportedPlatforms</key><array><string>iPhoneOS</string></array>
<key>CFBundleExecutable</key><string>gotest</string>
<key>CFBundleVersion</key><string>1.0</string>
<key>CFBundleIdentifier</key><string>` + bundleID + `</string>
<key>CFBundleIdentifier</key><string>golang.gotest</string>
<key>CFBundleResourceSpecification</key><string>ResourceRules.plist</string>
<key>LSRequiresIPhoneOS</key><true/>
<key>CFBundleDisplayName</key><string>gotest</string>
<key>GoExecWrapperWorkingDirectory</key><string>` + pkgpath + `</string>
</dict>
</plist>
`
}
func entitlementsPlist() string {
return `<?xml version="1.0" encoding="UTF-8"?>
@@ -606,11 +584,11 @@ func entitlementsPlist() string {
<plist version="1.0">
<dict>
<key>keychain-access-groups</key>
<array><string>` + appID + `</string></array>
<array><string>` + appID + `.golang.gotest</string></array>
<key>get-task-allow</key>
<true/>
<key>application-identifier</key>
<string>` + appID + `</string>
<string>` + appID + `.golang.gotest</string>
<key>com.apple.developer.team-identifier</key>
<string>` + teamID + `</string>
</dict>

View File

@@ -37,26 +37,6 @@ go src=..
testdata
+
vendor
github.com
google
pprof
internal
driver
testdata
+
graph
testdata
+
report
testdata
+
profile
testdata
+
ianlancetaylor
demangle
testdata
+
golang.org
x
arch
@@ -162,8 +142,6 @@ go src=..
regexp
testdata
+
runtime
textflag.h
strconv
testdata
+

View File

@@ -158,15 +158,11 @@ func (fi headerFileInfo) Mode() (mode os.FileMode) {
// sysStat, if non-nil, populates h from system-dependent fields of fi.
var sysStat func(fi os.FileInfo, h *Header) error
// Mode constants from the tar spec.
const (
// Mode constants from the USTAR spec:
// See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_06
c_ISUID = 04000 // Set uid
c_ISGID = 02000 // Set gid
c_ISVTX = 01000 // Save text (sticky bit)
// Common Unix mode constants; these are not defined in any common tar standard.
// Header.FileInfo understands these, but FileInfoHeader will never produce these.
c_ISUID = 04000 // Set uid
c_ISGID = 02000 // Set gid
c_ISVTX = 01000 // Save text (sticky bit)
c_ISDIR = 040000 // Directory
c_ISFIFO = 010000 // FIFO
c_ISREG = 0100000 // Regular file
@@ -212,24 +208,30 @@ func FileInfoHeader(fi os.FileInfo, link string) (*Header, error) {
}
switch {
case fm.IsRegular():
h.Mode |= c_ISREG
h.Typeflag = TypeReg
h.Size = fi.Size()
case fi.IsDir():
h.Typeflag = TypeDir
h.Mode |= c_ISDIR
h.Name += "/"
case fm&os.ModeSymlink != 0:
h.Typeflag = TypeSymlink
h.Mode |= c_ISLNK
h.Linkname = link
case fm&os.ModeDevice != 0:
if fm&os.ModeCharDevice != 0 {
h.Mode |= c_ISCHR
h.Typeflag = TypeChar
} else {
h.Mode |= c_ISBLK
h.Typeflag = TypeBlock
}
case fm&os.ModeNamedPipe != 0:
h.Typeflag = TypeFifo
h.Mode |= c_ISFIFO
case fm&os.ModeSocket != 0:
return nil, fmt.Errorf("archive/tar: sockets not supported")
h.Mode |= c_ISSOCK
default:
return nil, fmt.Errorf("archive/tar: unknown file mode %v", fm)
}

View File

@@ -6,11 +6,9 @@ package tar
import (
"bytes"
"internal/testenv"
"io/ioutil"
"os"
"path"
"path/filepath"
"reflect"
"strings"
"testing"
@@ -29,7 +27,7 @@ func TestFileInfoHeader(t *testing.T) {
if g, e := h.Name, "small.txt"; g != e {
t.Errorf("Name = %q; want %q", g, e)
}
if g, e := h.Mode, int64(fi.Mode().Perm()); g != e {
if g, e := h.Mode, int64(fi.Mode().Perm())|c_ISREG; g != e {
t.Errorf("Mode = %#o; want %#o", g, e)
}
if g, e := h.Size, int64(5); g != e {
@@ -57,7 +55,7 @@ func TestFileInfoHeaderDir(t *testing.T) {
t.Errorf("Name = %q; want %q", g, e)
}
// Ignoring c_ISGID for golang.org/issue/4867
if g, e := h.Mode&^c_ISGID, int64(fi.Mode().Perm()); g != e {
if g, e := h.Mode&^c_ISGID, int64(fi.Mode().Perm())|c_ISDIR; g != e {
t.Errorf("Mode = %#o; want %#o", g, e)
}
if g, e := h.Size, int64(0); g != e {
@@ -69,56 +67,40 @@ func TestFileInfoHeaderDir(t *testing.T) {
}
func TestFileInfoHeaderSymlink(t *testing.T) {
testenv.MustHaveSymlink(t)
tmpdir, err := ioutil.TempDir("", "TestFileInfoHeaderSymlink")
h, err := FileInfoHeader(symlink{}, "some-target")
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(tmpdir)
link := filepath.Join(tmpdir, "link")
target := tmpdir
err = os.Symlink(target, link)
if err != nil {
t.Fatal(err)
}
fi, err := os.Lstat(link)
if err != nil {
t.Fatal(err)
}
h, err := FileInfoHeader(fi, target)
if err != nil {
t.Fatal(err)
}
if g, e := h.Name, fi.Name(); g != e {
if g, e := h.Name, "some-symlink"; g != e {
t.Errorf("Name = %q; want %q", g, e)
}
if g, e := h.Linkname, target; g != e {
if g, e := h.Linkname, "some-target"; g != e {
t.Errorf("Linkname = %q; want %q", g, e)
}
if g, e := h.Typeflag, byte(TypeSymlink); g != e {
t.Errorf("Typeflag = %v; want %v", g, e)
}
}
type symlink struct{}
func (symlink) Name() string { return "some-symlink" }
func (symlink) Size() int64 { return 0 }
func (symlink) Mode() os.FileMode { return os.ModeSymlink }
func (symlink) ModTime() time.Time { return time.Time{} }
func (symlink) IsDir() bool { return false }
func (symlink) Sys() interface{} { return nil }
func TestRoundTrip(t *testing.T) {
data := []byte("some file contents")
var b bytes.Buffer
tw := NewWriter(&b)
hdr := &Header{
Name: "file.txt",
Uid: 1 << 21, // too big for 8 octal digits
Size: int64(len(data)),
// AddDate to strip monotonic clock reading,
// and Round to discard sub-second precision,
// both of which are not included in the tar header
// and would otherwise break the round-trip check
// below.
ModTime: time.Now().AddDate(0, 0, 0).Round(1 * time.Second),
Name: "file.txt",
Uid: 1 << 21, // too big for 8 octal digits
Size: int64(len(data)),
ModTime: time.Now(),
}
// tar only supports second precision.
hdr.ModTime = hdr.ModTime.Add(-time.Duration(hdr.ModTime.Nanosecond()) * time.Nanosecond)
if err := tw.WriteHeader(hdr); err != nil {
t.Fatalf("tw.WriteHeader: %v", err)
}
@@ -157,7 +139,7 @@ func TestHeaderRoundTrip(t *testing.T) {
// regular file.
h: &Header{
Name: "test.txt",
Mode: 0644,
Mode: 0644 | c_ISREG,
Size: 12,
ModTime: time.Unix(1360600916, 0),
Typeflag: TypeReg,
@@ -167,7 +149,7 @@ func TestHeaderRoundTrip(t *testing.T) {
// symbolic link.
h: &Header{
Name: "link.txt",
Mode: 0777,
Mode: 0777 | c_ISLNK,
Size: 0,
ModTime: time.Unix(1360600852, 0),
Typeflag: TypeSymlink,
@@ -177,7 +159,7 @@ func TestHeaderRoundTrip(t *testing.T) {
// character device node.
h: &Header{
Name: "dev/null",
Mode: 0666,
Mode: 0666 | c_ISCHR,
Size: 0,
ModTime: time.Unix(1360578951, 0),
Typeflag: TypeChar,
@@ -187,7 +169,7 @@ func TestHeaderRoundTrip(t *testing.T) {
// block device node.
h: &Header{
Name: "dev/sda",
Mode: 0660,
Mode: 0660 | c_ISBLK,
Size: 0,
ModTime: time.Unix(1360578954, 0),
Typeflag: TypeBlock,
@@ -197,7 +179,7 @@ func TestHeaderRoundTrip(t *testing.T) {
// directory.
h: &Header{
Name: "dir/",
Mode: 0755,
Mode: 0755 | c_ISDIR,
Size: 0,
ModTime: time.Unix(1360601116, 0),
Typeflag: TypeDir,
@@ -207,7 +189,7 @@ func TestHeaderRoundTrip(t *testing.T) {
// fifo node.
h: &Header{
Name: "dev/initctl",
Mode: 0600,
Mode: 0600 | c_ISFIFO,
Size: 0,
ModTime: time.Unix(1360578949, 0),
Typeflag: TypeFifo,
@@ -217,7 +199,7 @@ func TestHeaderRoundTrip(t *testing.T) {
// setuid.
h: &Header{
Name: "bin/su",
Mode: 0755 | c_ISUID,
Mode: 0755 | c_ISREG | c_ISUID,
Size: 23232,
ModTime: time.Unix(1355405093, 0),
Typeflag: TypeReg,
@@ -227,7 +209,7 @@ func TestHeaderRoundTrip(t *testing.T) {
// setguid.
h: &Header{
Name: "group.txt",
Mode: 0750 | c_ISGID,
Mode: 0750 | c_ISREG | c_ISGID,
Size: 0,
ModTime: time.Unix(1360602346, 0),
Typeflag: TypeReg,
@@ -237,7 +219,7 @@ func TestHeaderRoundTrip(t *testing.T) {
// sticky.
h: &Header{
Name: "sticky.txt",
Mode: 0600 | c_ISVTX,
Mode: 0600 | c_ISREG | c_ISVTX,
Size: 7,
ModTime: time.Unix(1360602540, 0),
Typeflag: TypeReg,
@@ -247,7 +229,7 @@ func TestHeaderRoundTrip(t *testing.T) {
// hard link.
h: &Header{
Name: "hard.txt",
Mode: 0644,
Mode: 0644 | c_ISREG,
Size: 0,
Linkname: "file.txt",
ModTime: time.Unix(1360600916, 0),
@@ -258,7 +240,7 @@ func TestHeaderRoundTrip(t *testing.T) {
// More information.
h: &Header{
Name: "info.txt",
Mode: 0600,
Mode: 0600 | c_ISREG,
Size: 0,
Uid: 1000,
Gid: 1000,

View File

@@ -103,46 +103,51 @@ func (r *pooledFlateReader) Close() error {
}
var (
compressors sync.Map // map[uint16]Compressor
decompressors sync.Map // map[uint16]Decompressor
mu sync.RWMutex // guards compressor and decompressor maps
compressors = map[uint16]Compressor{
Store: func(w io.Writer) (io.WriteCloser, error) { return &nopCloser{w}, nil },
Deflate: func(w io.Writer) (io.WriteCloser, error) { return newFlateWriter(w), nil },
}
decompressors = map[uint16]Decompressor{
Store: ioutil.NopCloser,
Deflate: newFlateReader,
}
)
func init() {
compressors.Store(Store, Compressor(func(w io.Writer) (io.WriteCloser, error) { return &nopCloser{w}, nil }))
compressors.Store(Deflate, Compressor(func(w io.Writer) (io.WriteCloser, error) { return newFlateWriter(w), nil }))
decompressors.Store(Store, Decompressor(ioutil.NopCloser))
decompressors.Store(Deflate, Decompressor(newFlateReader))
}
// RegisterDecompressor allows custom decompressors for a specified method ID.
// The common methods Store and Deflate are built in.
func RegisterDecompressor(method uint16, dcomp Decompressor) {
if _, dup := decompressors.LoadOrStore(method, dcomp); dup {
mu.Lock()
defer mu.Unlock()
if _, ok := decompressors[method]; ok {
panic("decompressor already registered")
}
decompressors[method] = dcomp
}
// RegisterCompressor registers custom compressors for a specified method ID.
// The common methods Store and Deflate are built in.
func RegisterCompressor(method uint16, comp Compressor) {
if _, dup := compressors.LoadOrStore(method, comp); dup {
mu.Lock()
defer mu.Unlock()
if _, ok := compressors[method]; ok {
panic("compressor already registered")
}
compressors[method] = comp
}
func compressor(method uint16) Compressor {
ci, ok := compressors.Load(method)
if !ok {
return nil
}
return ci.(Compressor)
mu.RLock()
defer mu.RUnlock()
return compressors[method]
}
func decompressor(method uint16) Decompressor {
di, ok := decompressors.Load(method)
if !ok {
return nil
}
return di.(Decompressor)
mu.RLock()
defer mu.RUnlock()
return decompressors[method]
}

View File

@@ -5,7 +5,7 @@
/*
Package zip provides support for reading and writing ZIP archives.
See: https://www.pkware.com/appnote
See: https://www.pkware.com/documents/casestudies/APPNOTE.TXT
This package does not support disk spanning.

View File

@@ -11,7 +11,6 @@ import (
"hash"
"hash/crc32"
"io"
"unicode/utf8"
)
// TODO(adg): support zip file comments
@@ -202,20 +201,6 @@ func (w *Writer) Create(name string) (io.Writer, error) {
return w.CreateHeader(header)
}
func hasValidUTF8(s string) bool {
n := 0
for _, r := range s {
// By default, ZIP uses CP437, which is only identical to ASCII for the printable characters.
if r < 0x20 || r >= 0x7f {
if !utf8.ValidRune(r) {
return false
}
n++
}
}
return n > 0
}
// CreateHeader adds a file to the zip file using the provided FileHeader
// for the file metadata.
// It returns a Writer to which the file contents should be written.
@@ -236,10 +221,6 @@ func (w *Writer) CreateHeader(fh *FileHeader) (io.Writer, error) {
fh.Flags |= 0x8 // we will write a data descriptor
if hasValidUTF8(fh.Name) || hasValidUTF8(fh.Comment) {
fh.Flags |= 0x800 // filename or comment have valid utf-8 string
}
fh.CreatorVersion = fh.CreatorVersion&0xff00 | zipVersion20 // preserve compatibility byte
fh.ReaderVersion = zipVersion20

View File

@@ -87,69 +87,6 @@ func TestWriter(t *testing.T) {
}
}
func TestWriterUTF8(t *testing.T) {
var utf8Tests = []struct {
name string
comment string
expect uint16
}{
{
name: "hi, hello",
comment: "in the world",
expect: 0x8,
},
{
name: "hi, こんにちわ",
comment: "in the world",
expect: 0x808,
},
{
name: "hi, hello",
comment: "in the 世界",
expect: 0x808,
},
{
name: "hi, こんにちわ",
comment: "in the 世界",
expect: 0x808,
},
}
// write a zip file
buf := new(bytes.Buffer)
w := NewWriter(buf)
for _, test := range utf8Tests {
h := &FileHeader{
Name: test.name,
Comment: test.comment,
Method: Deflate,
}
w, err := w.CreateHeader(h)
if err != nil {
t.Fatal(err)
}
w.Write([]byte{})
}
if err := w.Close(); err != nil {
t.Fatal(err)
}
// read it back
r, err := NewReader(bytes.NewReader(buf.Bytes()), int64(buf.Len()))
if err != nil {
t.Fatal(err)
}
for i, test := range utf8Tests {
got := r.File[i].Flags
t.Logf("name %v, comment %v", test.name, test.comment)
if got != test.expect {
t.Fatalf("Flags: got %v, want %v", got, test.expect)
}
}
}
func TestWriterOffset(t *testing.T) {
largeData := make([]byte, 1<<17)
for i := range largeData {
@@ -244,11 +181,12 @@ func testReadFile(t *testing.T, f *File, wt *WriteTest) {
}
func BenchmarkCompressedZipGarbage(b *testing.B) {
b.ReportAllocs()
var buf bytes.Buffer
bigBuf := bytes.Repeat([]byte("a"), 1<<20)
runOnce := func(buf *bytes.Buffer) {
for i := 0; i <= b.N; i++ {
buf.Reset()
zw := NewWriter(buf)
zw := NewWriter(&buf)
for j := 0; j < 3; j++ {
w, _ := zw.CreateHeader(&FileHeader{
Name: "foo",
@@ -257,19 +195,11 @@ func BenchmarkCompressedZipGarbage(b *testing.B) {
w.Write(bigBuf)
}
zw.Close()
}
b.ReportAllocs()
// Run once and then reset the timer.
// This effectively discards the very large initial flate setup cost,
// as well as the initialization of bigBuf.
runOnce(&bytes.Buffer{})
b.ResetTimer()
b.RunParallel(func(pb *testing.PB) {
var buf bytes.Buffer
for pb.Next() {
runOnce(&buf)
if i == 0 {
// Reset the timer after the first time through.
// This effectively discards the very large initial flate setup cost,
// as well as the initialization of bigBuf.
b.ResetTimer()
}
})
}
}

View File

@@ -255,7 +255,7 @@ func TestZip64EdgeCase(t *testing.T) {
testZip64DirectoryRecordLength(buf, t)
}
// Tests that we generate a zip64 file if the directory at offset
// Tests that we generate a zip64 file if the the directory at offset
// 0xFFFFFFFF, but not before.
func TestZip64DirectoryOffset(t *testing.T) {
if testing.Short() && race.Enabled {
@@ -681,18 +681,6 @@ func BenchmarkZip64Test(b *testing.B) {
}
}
func BenchmarkZip64TestSizes(b *testing.B) {
for _, size := range []int64{1 << 12, 1 << 20, 1 << 26} {
b.Run(fmt.Sprint(size), func(b *testing.B) {
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
testZip64(b, size)
}
})
})
}
}
func TestSuffixSaver(t *testing.T) {
const keep = 10
ss := &suffixSaver{keep: keep}

View File

@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer
// Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer
// object, creating another object (Reader or Writer) that also implements
// the interface but provides buffering and some help for textual I/O.
package bufio
@@ -458,7 +458,6 @@ func (b *Reader) ReadString(delim byte) (string, error) {
}
// WriteTo implements io.WriterTo.
// This may make multiple calls to the Read method of the underlying Reader.
func (b *Reader) WriteTo(w io.Writer) (n int64, err error) {
n, err = b.writeBuf(w)
if err != nil {
@@ -514,7 +513,7 @@ func (b *Reader) writeBuf(w io.Writer) (int64, error) {
// Writer implements buffering for an io.Writer object.
// If an error occurs writing to a Writer, no more data will be
// accepted and all subsequent writes, and Flush, will return the error.
// accepted and all subsequent writes will return the error.
// After all data has been written, the client should call the
// Flush method to guarantee all data has been forwarded to
// the underlying io.Writer.

View File

@@ -169,6 +169,7 @@ func genLine(buf *bytes.Buffer, lineNum, n int, addNewline bool) {
}
buf.WriteByte('\n')
}
return
}
// Test the line splitter, including some carriage returns but no long lines.

View File

@@ -19,70 +19,52 @@ fi
sete=false
if [ "$1" = "-e" ]; then
sete=true
shift
sete=true
shift
fi
if [ "$sete" = true ]; then
set -e
set -e
fi
pattern="$1"
if [ "$pattern" = "" ]; then
pattern=.
pattern=.
fi
./make.bash || exit 1
GOROOT="$(cd .. && pwd)"
gettargets() {
../bin/go tool dist list | sed -e 's|/|-|'
echo linux-386-387
echo linux-arm-arm5
}
selectedtargets() {
gettargets | egrep -v 'android-arm|darwin-arm' | egrep "$pattern"
}
# put linux, nacl first in the target list to get all the architectures up front.
linux_nacl_targets() {
selectedtargets | egrep 'linux|nacl' | sort
}
non_linux_nacl_targets() {
selectedtargets | egrep -v 'linux|nacl' | sort
}
# Note words in $targets are separated by both newlines and spaces.
targets="$(linux_nacl_targets) $(non_linux_nacl_targets)"
targets="$((../bin/go tool dist list | sed -n 's/^\(.*\)\/\(.*\)/\1-\2/p'; echo linux-386-387 linux-arm-arm5) | sort | egrep -v android-arm | egrep "$pattern" | egrep 'linux|nacl')
$(../bin/go tool dist list | sed -n 's/^\(.*\)\/\(.*\)/\1-\2/p' | egrep -v 'android-arm|darwin-arm' | egrep "$pattern" | egrep -v 'linux|nacl')"
failed=false
for target in $targets
do
echo ""
echo "### Building $target"
export GOOS=$(echo $target | sed 's/-.*//')
export GOARCH=$(echo $target | sed 's/.*-//')
unset GO386 GOARM
if [ "$GOARCH" = "arm5" ]; then
export GOARCH=arm
export GOARM=5
fi
if [ "$GOARCH" = "387" ]; then
export GOARCH=386
export GO386=387
fi
if ! "$GOROOT/bin/go" build -a std cmd; then
failed=true
if $sete; then
exit 1
fi
fi
echo ""
echo "### Building $target"
export GOOS=$(echo $target | sed 's/-.*//')
export GOARCH=$(echo $target | sed 's/.*-//')
unset GO386 GOARM
if [ "$GOARCH" = "arm5" ]; then
export GOARCH=arm
export GOARM=5
fi
if [ "$GOARCH" = "387" ]; then
export GOARCH=386
export GO386=387
fi
if ! "$GOROOT/bin/go" build -a std cmd; then
failed=true
if $sete; then
exit 1
fi
fi
done
if [ "$failed" = "true" ]; then
echo "" 1>&2
echo "Build(s) failed." 1>&2
exit 1
echo "" 1>&2
echo "Build(s) failed." 1>&2
exit 1
fi

View File

@@ -85,11 +85,11 @@ type uintptr uintptr
// byte is an alias for uint8 and is equivalent to uint8 in all ways. It is
// used, by convention, to distinguish byte values from 8-bit unsigned
// integer values.
type byte = uint8
type byte byte
// rune is an alias for int32 and is equivalent to int32 in all ways. It is
// used, by convention, to distinguish character values from integer values.
type rune = int32
type rune rune
// iota is a predeclared identifier representing the untyped integer ordinal
// number of the current const specification in a (usually parenthesized)
@@ -179,7 +179,7 @@ func cap(v Type) int
// Channel: The channel's buffer is initialized with the specified
// buffer capacity. If zero, or the size is omitted, the channel is
// unbuffered.
func make(t Type, size ...IntegerType) Type
func make(Type, size IntegerType) Type
// The new built-in function allocates memory. The first argument is a type,
// not a value, and the value returned is a pointer to a newly

View File

@@ -15,15 +15,10 @@ import (
// A Buffer is a variable-sized buffer of bytes with Read and Write methods.
// The zero value for Buffer is an empty buffer ready to use.
type Buffer struct {
buf []byte // contents are the bytes buf[off : len(buf)]
off int // read at &buf[off], write at &buf[len(buf)]
lastRead readOp // last read operation, so that Unread* can work correctly.
// FIXME: lastRead can fit in a single byte
// memory to hold first slice; helps small buffers avoid allocation.
// FIXME: it would be advisable to align Buffer to cachelines to avoid false
// sharing.
bootstrap [64]byte
buf []byte // contents are the bytes buf[off : len(buf)]
off int // read at &buf[off], write at &buf[len(buf)]
bootstrap [64]byte // memory to hold first slice; helps small buffers avoid allocation.
lastRead readOp // last read operation, so that Unread* can work correctly.
}
// The readOp constants describe the last action performed on
@@ -73,13 +68,13 @@ func (b *Buffer) Cap() int { return cap(b.buf) }
// but continues to use the same allocated storage.
// It panics if n is negative or greater than the length of the buffer.
func (b *Buffer) Truncate(n int) {
if n == 0 {
b.Reset()
return
}
b.lastRead = opInvalid
if n < 0 || n > b.Len() {
switch {
case n < 0 || n > b.Len():
panic("bytes.Buffer: truncation out of range")
case n == 0:
// Reuse buffer space.
b.off = 0
}
b.buf = b.buf[0 : b.off+n]
}
@@ -87,22 +82,7 @@ func (b *Buffer) Truncate(n int) {
// Reset resets the buffer to be empty,
// but it retains the underlying storage for use by future writes.
// Reset is the same as Truncate(0).
func (b *Buffer) Reset() {
b.buf = b.buf[:0]
b.off = 0
b.lastRead = opInvalid
}
// tryGrowByReslice is a inlineable version of grow for the fast-case where the
// internal buffer only needs to be resliced.
// It returns the index where bytes should be written and whether it succeeded.
func (b *Buffer) tryGrowByReslice(n int) (int, bool) {
if l := len(b.buf); l+n <= cap(b.buf) {
b.buf = b.buf[:l+n]
return l, true
}
return 0, false
}
func (b *Buffer) Reset() { b.Truncate(0) }
// grow grows the buffer to guarantee space for n more bytes.
// It returns the index where bytes should be written.
@@ -111,33 +91,29 @@ func (b *Buffer) grow(n int) int {
m := b.Len()
// If buffer is empty, reset to recover space.
if m == 0 && b.off != 0 {
b.Reset()
b.Truncate(0)
}
// Try to grow by means of a reslice.
if i, ok := b.tryGrowByReslice(n); ok {
return i
}
// Check if we can make use of bootstrap array.
if b.buf == nil && n <= len(b.bootstrap) {
b.buf = b.bootstrap[:n]
return 0
}
if m+n <= cap(b.buf)/2 {
// We can slide things down instead of allocating a new
// slice. We only need m+n <= cap(b.buf) to slide, but
// we instead let capacity get twice as large so we
// don't spend all our time copying.
copy(b.buf[:], b.buf[b.off:])
} else {
// Not enough space anywhere, we need to allocate.
buf := makeSlice(2*cap(b.buf) + n)
copy(buf, b.buf[b.off:])
if len(b.buf)+n > cap(b.buf) {
var buf []byte
if b.buf == nil && n <= len(b.bootstrap) {
buf = b.bootstrap[0:]
} else if m+n <= cap(b.buf)/2 {
// We can slide things down instead of allocating a new
// slice. We only need m+n <= cap(b.buf) to slide, but
// we instead let capacity get twice as large so we
// don't spend all our time copying.
copy(b.buf[:], b.buf[b.off:])
buf = b.buf[:m]
} else {
// not enough space anywhere
buf = makeSlice(2*cap(b.buf) + n)
copy(buf, b.buf[b.off:])
}
b.buf = buf
b.off = 0
}
// Restore b.off and len(b.buf).
b.off = 0
b.buf = b.buf[:m+n]
return m
b.buf = b.buf[0 : b.off+m+n]
return b.off + m
}
// Grow grows the buffer's capacity, if necessary, to guarantee space for
@@ -158,10 +134,7 @@ func (b *Buffer) Grow(n int) {
// buffer becomes too large, Write will panic with ErrTooLarge.
func (b *Buffer) Write(p []byte) (n int, err error) {
b.lastRead = opInvalid
m, ok := b.tryGrowByReslice(len(p))
if !ok {
m = b.grow(len(p))
}
m := b.grow(len(p))
return copy(b.buf[m:], p), nil
}
@@ -170,10 +143,7 @@ func (b *Buffer) Write(p []byte) (n int, err error) {
// buffer becomes too large, WriteString will panic with ErrTooLarge.
func (b *Buffer) WriteString(s string) (n int, err error) {
b.lastRead = opInvalid
m, ok := b.tryGrowByReslice(len(s))
if !ok {
m = b.grow(len(s))
}
m := b.grow(len(s))
return copy(b.buf[m:], s), nil
}
@@ -191,7 +161,7 @@ func (b *Buffer) ReadFrom(r io.Reader) (n int64, err error) {
b.lastRead = opInvalid
// If buffer is empty, reset to recover space.
if b.off >= len(b.buf) {
b.Reset()
b.Truncate(0)
}
for {
if free := cap(b.buf) - len(b.buf); free < MinRead {
@@ -255,7 +225,7 @@ func (b *Buffer) WriteTo(w io.Writer) (n int64, err error) {
}
}
// Buffer is now empty; reset.
b.Reset()
b.Truncate(0)
return
}
@@ -265,10 +235,7 @@ func (b *Buffer) WriteTo(w io.Writer) (n int64, err error) {
// ErrTooLarge.
func (b *Buffer) WriteByte(c byte) error {
b.lastRead = opInvalid
m, ok := b.tryGrowByReslice(1)
if !ok {
m = b.grow(1)
}
m := b.grow(1)
b.buf[m] = c
return nil
}
@@ -283,10 +250,7 @@ func (b *Buffer) WriteRune(r rune) (n int, err error) {
return 1, nil
}
b.lastRead = opInvalid
m, ok := b.tryGrowByReslice(utf8.UTFMax)
if !ok {
m = b.grow(utf8.UTFMax)
}
m := b.grow(utf8.UTFMax)
n = utf8.EncodeRune(b.buf[m:m+utf8.UTFMax], r)
b.buf = b.buf[:m+n]
return n, nil
@@ -300,7 +264,7 @@ func (b *Buffer) Read(p []byte) (n int, err error) {
b.lastRead = opInvalid
if b.off >= len(b.buf) {
// Buffer is empty, reset to recover space.
b.Reset()
b.Truncate(0)
if len(p) == 0 {
return
}
@@ -338,7 +302,7 @@ func (b *Buffer) ReadByte() (byte, error) {
b.lastRead = opInvalid
if b.off >= len(b.buf) {
// Buffer is empty, reset to recover space.
b.Reset()
b.Truncate(0)
return 0, io.EOF
}
c := b.buf[b.off]
@@ -356,7 +320,7 @@ func (b *Buffer) ReadRune() (r rune, size int, err error) {
b.lastRead = opInvalid
if b.off >= len(b.buf) {
// Buffer is empty, reset to recover space.
b.Reset()
b.Truncate(0)
return 0, 0, io.EOF
}
c := b.buf[b.off]
@@ -373,12 +337,12 @@ func (b *Buffer) ReadRune() (r rune, size int, err error) {
// UnreadRune unreads the last rune returned by ReadRune.
// If the most recent read or write operation on the buffer was
// not a successful ReadRune, UnreadRune returns an error. (In this regard
// not a ReadRune, UnreadRune returns an error. (In this regard
// it is stricter than UnreadByte, which will unread the last byte
// from any read operation.)
func (b *Buffer) UnreadRune() error {
if b.lastRead <= opInvalid {
return errors.New("bytes.Buffer: UnreadRune: previous operation was not a successful ReadRune")
return errors.New("bytes.Buffer: UnreadRune: previous operation was not ReadRune")
}
if b.off >= int(b.lastRead) {
b.off -= int(b.lastRead)
@@ -387,13 +351,12 @@ func (b *Buffer) UnreadRune() error {
return nil
}
// UnreadByte unreads the last byte returned by the most recent successful
// read operation that read at least one byte. If a write has happened since
// the last read, if the last read returned an error, or if the read read zero
// bytes, UnreadByte returns an error.
// UnreadByte unreads the last byte returned by the most recent
// read operation. If write has happened since the last read, UnreadByte
// returns an error.
func (b *Buffer) UnreadByte() error {
if b.lastRead == opInvalid {
return errors.New("bytes.Buffer: UnreadByte: previous operation was not a successful read")
return errors.New("bytes.Buffer: UnreadByte: previous operation was not a read")
}
b.lastRead = opInvalid
if b.off > 0 {
@@ -441,12 +404,10 @@ func (b *Buffer) ReadString(delim byte) (line string, err error) {
return string(slice), err
}
// NewBuffer creates and initializes a new Buffer using buf as its
// initial contents. The new Buffer takes ownership of buf, and the
// caller should not use buf after this call. NewBuffer is intended to
// prepare a Buffer to read existing data. It can also be used to size
// the internal buffer for writing. To do that, buf should have the
// desired capacity but a length of zero.
// NewBuffer creates and initializes a new Buffer using buf as its initial
// contents. It is intended to prepare a Buffer to read existing data. It
// can also be used to size the internal buffer for writing. To do that,
// buf should have the desired capacity but a length of zero.
//
// In most cases, new(Buffer) (or just declaring a Buffer variable) is
// sufficient to initialize a Buffer.

View File

@@ -6,10 +6,8 @@ package bytes_test
import (
. "bytes"
"internal/testenv"
"io"
"math/rand"
"os/exec"
"runtime"
"testing"
"unicode/utf8"
@@ -313,19 +311,6 @@ func TestRuneIO(t *testing.T) {
// Check that UnreadRune works
buf.Reset()
// check at EOF
if err := buf.UnreadRune(); err == nil {
t.Fatal("UnreadRune at EOF: got no error")
}
if _, _, err := buf.ReadRune(); err == nil {
t.Fatal("ReadRune at EOF: got no error")
}
if err := buf.UnreadRune(); err == nil {
t.Fatal("UnreadRune after ReadRune at EOF: got no error")
}
// check not at EOF
buf.Write(b)
for r := rune(0); r < NRune; r++ {
r1, size, _ := buf.ReadRune()
@@ -488,34 +473,15 @@ func TestReadEmptyAtEOF(t *testing.T) {
func TestUnreadByte(t *testing.T) {
b := new(Buffer)
// check at EOF
if err := b.UnreadByte(); err == nil {
t.Fatal("UnreadByte at EOF: got no error")
}
if _, err := b.ReadByte(); err == nil {
t.Fatal("ReadByte at EOF: got no error")
}
if err := b.UnreadByte(); err == nil {
t.Fatal("UnreadByte after ReadByte at EOF: got no error")
}
// check not at EOF
b.WriteString("abcdefghijklmnopqrstuvwxyz")
// after unsuccessful read
if n, err := b.Read(nil); n != 0 || err != nil {
t.Fatalf("Read(nil) = %d,%v; want 0,nil", n, err)
}
if err := b.UnreadByte(); err == nil {
t.Fatal("UnreadByte after Read(nil): got no error")
}
// after successful read
if _, err := b.ReadBytes('m'); err != nil {
_, err := b.ReadBytes('m')
if err != nil {
t.Fatalf("ReadBytes: %v", err)
}
if err := b.UnreadByte(); err != nil {
err = b.UnreadByte()
if err != nil {
t.Fatalf("UnreadByte: %v", err)
}
c, err := b.ReadByte()
@@ -548,38 +514,6 @@ func TestBufferGrowth(t *testing.T) {
}
}
// Test that tryGrowByReslice is inlined.
// Only execute on "linux-amd64" builder in order to avoid breakage.
func TestTryGrowByResliceInlined(t *testing.T) {
targetBuilder := "linux-amd64"
if testenv.Builder() != targetBuilder {
t.Skipf("%q gets executed on %q builder only", t.Name(), targetBuilder)
}
t.Parallel()
goBin := testenv.GoToolPath(t)
out, err := exec.Command(goBin, "tool", "nm", goBin).CombinedOutput()
if err != nil {
t.Fatalf("go tool nm: %v: %s", err, out)
}
// Verify this doesn't exist:
sym := "bytes.(*Buffer).tryGrowByReslice"
if Contains(out, []byte(sym)) {
t.Errorf("found symbol %q in cmd/go, but should be inlined", sym)
}
}
func BenchmarkWriteByte(b *testing.B) {
const n = 4 << 10
b.SetBytes(n)
buf := NewBuffer(make([]byte, n))
for i := 0; i < b.N; i++ {
buf.Reset()
for i := 0; i < n; i++ {
buf.WriteByte('x')
}
}
}
func BenchmarkWriteRune(b *testing.B) {
const n = 4 << 10
const r = '☺'

View File

@@ -46,21 +46,36 @@ func explode(s []byte, n int) [][]byte {
return a[0:na]
}
// countGeneric actually implements Count
func countGeneric(s, sep []byte) int {
// special case
if len(sep) == 0 {
// Count counts the number of non-overlapping instances of sep in s.
// If sep is an empty slice, Count returns 1 + the number of Unicode code points in s.
func Count(s, sep []byte) int {
n := len(sep)
if n == 0 {
return utf8.RuneCount(s) + 1
}
n := 0
for {
i := Index(s, sep)
if i == -1 {
return n
}
n++
s = s[i+len(sep):]
if n > len(s) {
return 0
}
count := 0
c := sep[0]
i := 0
t := s[:len(s)-n+1]
for i < len(t) {
if t[i] != c {
o := IndexByte(t[i:], c)
if o < 0 {
break
}
i += o
}
if n == 1 || Equal(s[i:i+n], sep) {
count++
i += n
continue
}
i++
}
return count
}
// Contains reports whether subslice is within b.
@@ -214,21 +229,20 @@ func genSplit(s, sep []byte, sepSave, n int) [][]byte {
if n < 0 {
n = Count(s, sep) + 1
}
c := sep[0]
start := 0
a := make([][]byte, n)
n--
i := 0
for i < n {
m := Index(s, sep)
if m < 0 {
break
na := 0
for i := 0; i+len(sep) <= len(s) && na+1 < n; i++ {
if s[i] == c && (len(sep) == 1 || Equal(s[i:i+len(sep)], sep)) {
a[na] = s[start : i+sepSave]
na++
start = i + len(sep)
i += len(sep) - 1
}
a[i] = s[:m+sepSave]
s = s[m+len(sep):]
i++
}
a[i] = s
return a[:i+1]
a[na] = s[start:]
return a[0 : na+1]
}
// SplitN slices s into subslices separated by sep and returns a slice of

View File

@@ -4,19 +4,17 @@
package bytes
import "internal/cpu"
//go:noescape
// indexShortStr returns the index of the first instance of c in s, or -1 if c is not present in s.
// indexShortStr requires 2 <= len(c) <= shortStringLen
func indexShortStr(s, c []byte) int // ../runtime/asm_amd64.s
func countByte(s []byte, c byte) int // ../runtime/asm_amd64.s
func indexShortStr(s, c []byte) int // ../runtime/asm_$GOARCH.s
func supportAVX2() bool // ../runtime/asm_$GOARCH.s
var shortStringLen int
func init() {
if cpu.X86.HasAVX2 {
if supportAVX2() {
shortStringLen = 63
} else {
shortStringLen = 31
@@ -96,15 +94,6 @@ func Index(s, sep []byte) int {
return -1
}
// Count counts the number of non-overlapping instances of sep in s.
// If sep is an empty slice, Count returns 1 + the number of Unicode code points in s.
func Count(s, sep []byte) int {
if len(sep) == 1 && cpu.X86.HasPOPCNT {
return countByte(s, sep[0])
}
return countGeneric(s, sep)
}
// primeRK is the prime base used in Rabin-Karp algorithm.
const primeRK = 16777619

View File

@@ -39,9 +39,3 @@ func Index(s, sep []byte) int {
}
return -1
}
// Count counts the number of non-overlapping instances of sep in s.
// If sep is an empty slice, Count returns 1 + the number of Unicode code points in s.
func Count(s, sep []byte) int {
return countGeneric(s, sep)
}

View File

@@ -97,12 +97,6 @@ func Index(s, sep []byte) int {
return -1
}
// Count counts the number of non-overlapping instances of sep in s.
// If sep is an empty slice, Count returns 1 + the number of Unicode code points in s.
func Count(s, sep []byte) int {
return countGeneric(s, sep)
}
// primeRK is the prime base used in Rabin-Karp algorithm.
const primeRK = 16777619

View File

@@ -396,79 +396,6 @@ func TestIndexRune(t *testing.T) {
}
}
// test count of a single byte across page offsets
func TestCountByte(t *testing.T) {
b := make([]byte, 5015) // bigger than a page
windows := []int{1, 2, 3, 4, 15, 16, 17, 31, 32, 33, 63, 64, 65, 128}
testCountWindow := func(i, window int) {
for j := 0; j < window; j++ {
b[i+j] = byte(100)
p := Count(b[i:i+window], []byte{100})
if p != j+1 {
t.Errorf("TestCountByte.Count(%q, 100) = %d", b[i:i+window], p)
}
pGeneric := CountGeneric(b[i:i+window], []byte{100})
if pGeneric != j+1 {
t.Errorf("TestCountByte.CountGeneric(%q, 100) = %d", b[i:i+window], p)
}
}
}
maxWnd := windows[len(windows)-1]
for i := 0; i <= 2*maxWnd; i++ {
for _, window := range windows {
if window > len(b[i:]) {
window = len(b[i:])
}
testCountWindow(i, window)
for j := 0; j < window; j++ {
b[i+j] = byte(0)
}
}
}
for i := 4096 - (maxWnd + 1); i < len(b); i++ {
for _, window := range windows {
if window > len(b[i:]) {
window = len(b[i:])
}
testCountWindow(i, window)
for j := 0; j < window; j++ {
b[i+j] = byte(0)
}
}
}
}
// Make sure we don't count bytes outside our window
func TestCountByteNoMatch(t *testing.T) {
b := make([]byte, 5015)
windows := []int{1, 2, 3, 4, 15, 16, 17, 31, 32, 33, 63, 64, 65, 128}
for i := 0; i <= len(b); i++ {
for _, window := range windows {
if window > len(b[i:]) {
window = len(b[i:])
}
// Fill the window with non-match
for j := 0; j < window; j++ {
b[i+j] = byte(100)
}
// Try to find something that doesn't exist
p := Count(b[i:i+window], []byte{0})
if p != 0 {
t.Errorf("TestCountByteNoMatch(%q, 0) = %d", b[i:i+window], p)
}
pGeneric := CountGeneric(b[i:i+window], []byte{0})
if pGeneric != 0 {
t.Errorf("TestCountByteNoMatch.CountGeneric(%q, 100) = %d", b[i:i+window], p)
}
for j := 0; j < window; j++ {
b[i+j] = byte(0)
}
}
}
}
var bmbuf []byte
func valName(x int) string {
@@ -662,26 +589,6 @@ func BenchmarkCountEasy(b *testing.B) {
})
}
func BenchmarkCountSingle(b *testing.B) {
benchBytes(b, indexSizes, func(b *testing.B, n int) {
buf := bmbuf[0:n]
step := 8
for i := 0; i < len(buf); i += step {
buf[i] = 1
}
expect := (len(buf) + (step - 1)) / step
for i := 0; i < b.N; i++ {
j := Count(buf, []byte{1})
if j != expect {
b.Fatal("bad count", j, expect)
}
}
for i := 0; i < len(buf); i++ {
buf[i] = 0
}
})
}
type ExplodeTest struct {
s string
n int
@@ -1525,59 +1432,6 @@ func BenchmarkTrimSpace(b *testing.B) {
}
}
func makeBenchInputHard() []byte {
tokens := [...]string{
"<a>", "<p>", "<b>", "<strong>",
"</a>", "</p>", "</b>", "</strong>",
"hello", "world",
}
x := make([]byte, 0, 1<<20)
for {
i := rand.Intn(len(tokens))
if len(x)+len(tokens[i]) >= 1<<20 {
break
}
x = append(x, tokens[i]...)
}
return x
}
var benchInputHard = makeBenchInputHard()
func BenchmarkSplitEmptySeparator(b *testing.B) {
for i := 0; i < b.N; i++ {
Split(benchInputHard, nil)
}
}
func BenchmarkSplitSingleByteSeparator(b *testing.B) {
sep := []byte("/")
for i := 0; i < b.N; i++ {
Split(benchInputHard, sep)
}
}
func BenchmarkSplitMultiByteSeparator(b *testing.B) {
sep := []byte("hello")
for i := 0; i < b.N; i++ {
Split(benchInputHard, sep)
}
}
func BenchmarkSplitNSingleByteSeparator(b *testing.B) {
sep := []byte("/")
for i := 0; i < b.N; i++ {
SplitN(benchInputHard, sep, 10)
}
}
func BenchmarkSplitNMultiByteSeparator(b *testing.B) {
sep := []byte("hello")
for i := 0; i < b.N; i++ {
SplitN(benchInputHard, sep, 10)
}
}
func BenchmarkRepeat(b *testing.B) {
for i := 0; i < b.N; i++ {
Repeat([]byte("-"), 80)

View File

@@ -7,4 +7,3 @@ package bytes
// Export func for testing
var IndexBytePortable = indexBytePortable
var EqualPortable = equalPortable
var CountGeneric = countGeneric

View File

@@ -89,25 +89,16 @@ func testAddr2Line(t *testing.T, exepath, addr string) {
func TestAddr2Line(t *testing.T) {
testenv.MustHaveGoBuild(t)
syms := loadSyms(t)
tmpDir, err := ioutil.TempDir("", "TestAddr2Line")
if err != nil {
t.Fatal("TempDir failed: ", err)
}
defer os.RemoveAll(tmpDir)
// Build copy of test binary with debug symbols,
// since the one running now may not have them.
exepath := filepath.Join(tmpDir, "testaddr2line_test.exe")
out, err := exec.Command(testenv.GoToolPath(t), "test", "-c", "-o", exepath, "cmd/addr2line").CombinedOutput()
if err != nil {
t.Fatalf("go test -c -o %v cmd/addr2line: %v\n%s", exepath, err, string(out))
}
os.Args[0] = exepath
syms := loadSyms(t)
exepath = filepath.Join(tmpDir, "testaddr2line.exe")
out, err = exec.Command(testenv.GoToolPath(t), "build", "-o", exepath, "cmd/addr2line").CombinedOutput()
exepath := filepath.Join(tmpDir, "testaddr2line.exe")
out, err := exec.Command(testenv.GoToolPath(t), "build", "-o", exepath, "cmd/addr2line").CombinedOutput()
if err != nil {
t.Fatalf("go build -o %v cmd/addr2line: %v\n%s", exepath, err, string(out))
}

View File

@@ -26,7 +26,7 @@ func main() {
}
out, err := exec.Command("go", "tool", "api",
"-c", file("go1", "go1.1", "go1.2", "go1.3", "go1.4", "go1.5", "go1.6", "go1.7", "go1.8", "go1.9"),
"-c", file("go1", "go1.1", "go1.2", "go1.3", "go1.4", "go1.5", "go1.6", "go1.7", "go1.8"),
"-next", file("next"),
"-except", file("except")).CombinedOutput()
if err != nil {

View File

@@ -236,15 +236,15 @@ func archArm64() *Arch {
register := make(map[string]int16)
// Create maps for easy lookup of instruction names etc.
// Note that there is no list of names as there is for 386 and amd64.
register[obj.Rconv(arm64.REGSP)] = int16(arm64.REGSP)
register[arm64.Rconv(arm64.REGSP)] = int16(arm64.REGSP)
for i := arm64.REG_R0; i <= arm64.REG_R31; i++ {
register[obj.Rconv(i)] = int16(i)
register[arm64.Rconv(i)] = int16(i)
}
for i := arm64.REG_F0; i <= arm64.REG_F31; i++ {
register[obj.Rconv(i)] = int16(i)
register[arm64.Rconv(i)] = int16(i)
}
for i := arm64.REG_V0; i <= arm64.REG_V31; i++ {
register[obj.Rconv(i)] = int16(i)
register[arm64.Rconv(i)] = int16(i)
}
register["LR"] = arm64.REGLINK
register["DAIF"] = arm64.REG_DAIF

View File

@@ -158,10 +158,10 @@ func ARMMRCOffset(op obj.As, cond string, x0, x1, x2, x3, x4, x5 int64) (offset
}
// IsARMMULA reports whether the op (as defined by an arm.A* constant) is
// MULA, MULS, MMULA, MMULS, MULABB, MULAWB or MULAWT, the 4-operand instructions.
// MULA, MULAWT or MULAWB, the 4-operand instructions.
func IsARMMULA(op obj.As) bool {
switch op {
case arm.AMULA, arm.AMULS, arm.AMMULA, arm.AMMULS, arm.AMULABB, arm.AMULAWB, arm.AMULAWT:
case arm.AMULA, arm.AMULAWB, arm.AMULAWT:
return true
}
return false

View File

@@ -43,8 +43,6 @@ var arm64Jump = map[string]bool{
"CBNZ": true,
"CBNZW": true,
"JMP": true,
"TBNZ": true,
"TBZ": true,
}
func jumpArm64(word string) bool {

View File

@@ -48,6 +48,24 @@ func jumpS390x(word string) bool {
return false
}
// IsS390xRLD reports whether the op (as defined by an s390x.A* constant) is
// one of the RLD-like instructions that require special handling.
// The FMADD-like instructions behave similarly.
func IsS390xRLD(op obj.As) bool {
switch op {
case s390x.AFMADD,
s390x.AFMADDS,
s390x.AFMSUB,
s390x.AFMSUBS,
s390x.AFNMADD,
s390x.AFNMADDS,
s390x.AFNMSUB,
s390x.AFNMSUBS:
return true
}
return false
}
// IsS390xCMP reports whether the op (as defined by an s390x.A* constant) is
// one of the CMP instructions that require special handling.
func IsS390xCMP(op obj.As) bool {
@@ -68,6 +86,38 @@ func IsS390xNEG(op obj.As) bool {
return false
}
// IsS390xWithLength reports whether the op (as defined by an s390x.A* constant)
// refers to an instruction which takes a length as its first argument.
func IsS390xWithLength(op obj.As) bool {
switch op {
case s390x.AMVC, s390x.ACLC, s390x.AXC, s390x.AOC, s390x.ANC:
return true
case s390x.AVLL, s390x.AVSTL:
return true
}
return false
}
// IsS390xWithIndex reports whether the op (as defined by an s390x.A* constant)
// refers to an instruction which takes an index as its first argument.
func IsS390xWithIndex(op obj.As) bool {
switch op {
case s390x.AVSCEG, s390x.AVSCEF, s390x.AVGEG, s390x.AVGEF:
return true
case s390x.AVGMG, s390x.AVGMF, s390x.AVGMH, s390x.AVGMB:
return true
case s390x.AVLEIG, s390x.AVLEIF, s390x.AVLEIH, s390x.AVLEIB:
return true
case s390x.AVLEG, s390x.AVLEF, s390x.AVLEH, s390x.AVLEB:
return true
case s390x.AVSTEG, s390x.AVSTEF, s390x.AVSTEH, s390x.AVSTEB:
return true
case s390x.AVPDI:
return true
}
return false
}
func s390xRegisterNumber(name string, n int16) (int16, bool) {
switch name {
case "AR":

View File

@@ -13,7 +13,6 @@ import (
"cmd/asm/internal/flags"
"cmd/asm/internal/lex"
"cmd/internal/obj"
"cmd/internal/objabi"
"cmd/internal/sys"
)
@@ -62,7 +61,7 @@ func (p *Parser) append(prog *obj.Prog, cond string, doLabel bool) {
}
prog.Pc = p.pc
if *flags.Debug {
fmt.Println(p.lineNum, prog)
fmt.Println(p.histLineNum, prog)
}
if testOut != nil {
fmt.Fprintln(testOut, prog)
@@ -152,7 +151,7 @@ func (p *Parser) asmText(word string, operands [][]lex.Token) {
frameSize = -frameSize
}
op = op[1:]
argSize := int64(objabi.ArgsSizeUnknown)
argSize := int64(obj.ArgsSizeUnknown)
if len(op) > 0 {
// There is an argument size. It must be a minus sign followed by a non-negative integer literal.
if len(op) != 2 || op[0].ScanToken != '-' || op[1].ScanToken != scanner.Int {
@@ -161,20 +160,23 @@ func (p *Parser) asmText(word string, operands [][]lex.Token) {
}
argSize = p.positiveAtoi(op[1].String())
}
p.ctxt.InitTextSym(nameAddr.Sym, int(flag))
prog := &obj.Prog{
Ctxt: p.ctxt,
As: obj.ATEXT,
Pos: p.pos(),
From: nameAddr,
Ctxt: p.ctxt,
As: obj.ATEXT,
Lineno: p.histLineNum,
From: nameAddr,
From3: &obj.Addr{
Type: obj.TYPE_CONST,
Offset: flag,
},
To: obj.Addr{
Type: obj.TYPE_TEXTSIZE,
Offset: frameSize,
// Argsize set below.
},
}
nameAddr.Sym.Func.Text = prog
prog.To.Val = int32(argSize)
p.append(prog, "", true)
}
@@ -292,11 +294,11 @@ func (p *Parser) asmPCData(word string, operands [][]lex.Token) {
// log.Printf("PCDATA $%d, $%d", key.Offset, value.Offset)
prog := &obj.Prog{
Ctxt: p.ctxt,
As: obj.APCDATA,
Pos: p.pos(),
From: key,
To: value,
Ctxt: p.ctxt,
As: obj.APCDATA,
Lineno: p.histLineNum,
From: key,
To: value,
}
p.append(prog, "", true)
}
@@ -322,11 +324,11 @@ func (p *Parser) asmFuncData(word string, operands [][]lex.Token) {
}
prog := &obj.Prog{
Ctxt: p.ctxt,
As: obj.AFUNCDATA,
Pos: p.pos(),
From: valueAddr,
To: nameAddr,
Ctxt: p.ctxt,
As: obj.AFUNCDATA,
Lineno: p.histLineNum,
From: valueAddr,
To: nameAddr,
}
p.append(prog, "", true)
}
@@ -338,9 +340,9 @@ func (p *Parser) asmFuncData(word string, operands [][]lex.Token) {
func (p *Parser) asmJump(op obj.As, cond string, a []obj.Addr) {
var target *obj.Addr
prog := &obj.Prog{
Ctxt: p.ctxt,
Pos: p.pos(),
As: op,
Ctxt: p.ctxt,
Lineno: p.histLineNum,
As: op,
}
switch len(a) {
case 1:
@@ -388,18 +390,6 @@ func (p *Parser) asmJump(op obj.As, cond string, a []obj.Addr) {
}
break
}
if p.arch.Family == sys.ARM64 {
// Special 3-operand jumps.
// a[0] must be immediate constant; a[1] is a register.
if a[0].Type != obj.TYPE_CONST {
p.errorf("%s: expected immediate constant; found %s", op, obj.Dconv(prog, &a[0]))
return
}
prog.From = a[0]
prog.Reg = p.getRegister(prog, op, &a[1])
target = &a[2]
break
}
fallthrough
default:
@@ -478,9 +468,9 @@ func (p *Parser) branch(jmp, target *obj.Prog) {
func (p *Parser) asmInstruction(op obj.As, cond string, a []obj.Addr) {
// fmt.Printf("%s %+v\n", op, a)
prog := &obj.Prog{
Ctxt: p.ctxt,
Pos: p.pos(),
As: op,
Ctxt: p.ctxt,
Lineno: p.histLineNum,
As: op,
}
switch len(a) {
case 0:
@@ -623,11 +613,12 @@ func (p *Parser) asmInstruction(op obj.As, cond string, a []obj.Addr) {
return
}
case sys.S390X:
prog.From = a[0]
if a[1].Type == obj.TYPE_REG {
prog.Reg = p.getRegister(prog, op, &a[1])
if arch.IsS390xWithLength(op) || arch.IsS390xWithIndex(op) {
prog.From = a[1]
prog.From3 = newAddr(a[0])
} else {
prog.From3 = newAddr(a[1])
prog.Reg = p.getRegister(prog, op, &a[1])
prog.From = a[0]
}
prog.To = a[2]
default:
@@ -639,12 +630,12 @@ func (p *Parser) asmInstruction(op obj.As, cond string, a []obj.Addr) {
// All must be registers.
p.getRegister(prog, op, &a[0])
r1 := p.getRegister(prog, op, &a[1])
r2 := p.getRegister(prog, op, &a[2])
p.getRegister(prog, op, &a[3])
p.getRegister(prog, op, &a[2])
r3 := p.getRegister(prog, op, &a[3])
prog.From = a[0]
prog.To = a[3]
prog.To = a[2]
prog.To.Type = obj.TYPE_REGREG2
prog.To.Offset = int64(r2)
prog.To.Offset = int64(r3)
prog.Reg = r1
break
}
@@ -710,13 +701,9 @@ func (p *Parser) asmInstruction(op obj.As, cond string, a []obj.Addr) {
}
}
if p.arch.Family == sys.S390X {
if a[1].Type != obj.TYPE_REG {
p.errorf("second operand must be a register in %s instruction", op)
return
}
prog.From = a[0]
prog.Reg = p.getRegister(prog, op, &a[1])
prog.From3 = newAddr(a[2])
prog.From = a[1]
prog.Reg = p.getRegister(prog, op, &a[2])
prog.From3 = newAddr(a[0])
prog.To = a[3]
break
}

View File

@@ -19,7 +19,6 @@ import (
"cmd/asm/internal/lex"
"cmd/internal/obj"
"cmd/internal/objabi"
)
// An end-to-end test for the assembler: Do we print what we parse?
@@ -27,12 +26,12 @@ import (
// result against a golden file.
func testEndToEnd(t *testing.T, goarch, file string) {
lex.InitHist()
input := filepath.Join("testdata", file+".s")
architecture, ctxt := setArch(goarch)
architecture.Init(ctxt)
lexer := lex.NewLexer(input)
lexer := lex.NewLexer(input, ctxt)
parser := NewParser(ctxt, architecture, lexer)
pList := new(obj.Plist)
pList := obj.Linknewplist(ctxt)
var ok bool
testOut = new(bytes.Buffer) // The assembler writes test output to this buffer.
ctxt.Bso = bufio.NewWriter(os.Stdout)
@@ -63,11 +62,6 @@ Diff:
for _, line := range lines {
lineno++
// Ignore include of textflag.h.
if strings.HasPrefix(line, "#include ") {
continue
}
// The general form of a test input line is:
// // comment
// INST args [// printed form] [// hex encoding]
@@ -186,7 +180,7 @@ Diff:
t.Errorf(format, args...)
ok = false
}
obj.Flushplist(ctxt, pList, nil)
obj.FlushplistNoFree(ctxt)
for p := top; p != nil; p = p.Link {
if p.As == obj.ATEXT {
@@ -270,11 +264,12 @@ var (
)
func testErrors(t *testing.T, goarch, file string) {
lex.InitHist()
input := filepath.Join("testdata", file+".s")
architecture, ctxt := setArch(goarch)
lexer := lex.NewLexer(input)
lexer := lex.NewLexer(input, ctxt)
parser := NewParser(ctxt, architecture, lexer)
pList := new(obj.Plist)
pList := obj.Linknewplist(ctxt)
var ok bool
testOut = new(bytes.Buffer) // The assembler writes test output to this buffer.
ctxt.Bso = bufio.NewWriter(os.Stdout)
@@ -290,7 +285,7 @@ func testErrors(t *testing.T, goarch, file string) {
errBuf.WriteString(s)
}
pList.Firstpc, ok = parser.Parse()
obj.Flushplist(ctxt, pList, nil)
obj.Flushplist(ctxt)
if ok && !failed {
t.Errorf("asm: %s had no errors", goarch)
}
@@ -306,7 +301,7 @@ func testErrors(t *testing.T, goarch, file string) {
continue
}
fileline := m[1]
if errors[fileline] != "" && errors[fileline] != line {
if errors[fileline] != "" {
t.Errorf("multiple errors on %s:\n\t%s\n\t%s", fileline, errors[fileline], line)
continue
}
@@ -353,28 +348,23 @@ func testErrors(t *testing.T, goarch, file string) {
}
func Test386EndToEnd(t *testing.T) {
defer func(old string) { objabi.GO386 = old }(objabi.GO386)
for _, go386 := range []string{"387", "sse2"} {
t.Logf("GO386=%v", go386)
objabi.GO386 = go386
defer os.Setenv("GO386", os.Getenv("GO386"))
for _, go386 := range []string{"387", "sse"} {
os.Setenv("GO386", go386)
t.Logf("GO386=%v", os.Getenv("GO386"))
testEndToEnd(t, "386", "386")
}
}
func TestARMEndToEnd(t *testing.T) {
defer func(old int) { objabi.GOARM = old }(objabi.GOARM)
for _, goarm := range []int{5, 6, 7} {
t.Logf("GOARM=%d", goarm)
objabi.GOARM = goarm
testEndToEnd(t, "arm", "arm")
if goarm == 6 {
testEndToEnd(t, "arm", "armv6")
}
}
}
defer os.Setenv("GOARM", os.Getenv("GOARM"))
func TestARMErrors(t *testing.T) {
testErrors(t, "arm", "armerror")
for _, goarm := range []string{"5", "6", "7"} {
os.Setenv("GOARM", goarm)
t.Logf("GOARM=%v", os.Getenv("GOARM"))
testEndToEnd(t, "arm", "arm")
}
}
func TestARM64EndToEnd(t *testing.T) {

View File

@@ -10,14 +10,13 @@ import (
"cmd/asm/internal/arch"
"cmd/asm/internal/lex"
"cmd/internal/obj"
"cmd/internal/objabi"
)
// A simple in-out test: Do we print what we parse?
func setArch(goarch string) (*arch.Arch, *obj.Link) {
objabi.GOOS = "linux" // obj can handle this OS for all architectures.
objabi.GOARCH = goarch
obj.GOOS = "linux" // obj can handle this OS for all architectures.
obj.GOARCH = goarch
architecture := arch.Set(goarch)
if architecture == nil {
panic("asm: unrecognized architecture " + goarch)

View File

@@ -19,14 +19,14 @@ import (
"cmd/asm/internal/flags"
"cmd/asm/internal/lex"
"cmd/internal/obj"
"cmd/internal/src"
"cmd/internal/sys"
)
type Parser struct {
lex lex.TokenReader
lineNum int // Line number in source file.
errorLine int // Line number of last error.
histLineNum int32 // Cumulative line number across source files.
errorLine int32 // (Cumulative) line number of last error.
errorCount int // Number of errors.
pc int64 // virtual PC; count of Progs; doesn't advance for GLOBL or DATA.
input []lex.Token
@@ -60,7 +60,7 @@ func NewParser(ctxt *obj.Link, ar *arch.Arch, lexer lex.TokenReader) *Parser {
}
}
// panicOnError is enabled when testing to abort execution on the first error
// panicOnError is enable when testing to abort execution on the first error
// and turn it into a recoverable panic.
var panicOnError bool
@@ -68,11 +68,11 @@ func (p *Parser) errorf(format string, args ...interface{}) {
if panicOnError {
panic(fmt.Errorf(format, args...))
}
if p.lineNum == p.errorLine {
if p.histLineNum == p.errorLine {
// Only one error per line.
return
}
p.errorLine = p.lineNum
p.errorLine = p.histLineNum
if p.lex != nil {
// Put file and line information on head of message.
format = "%s:%d: " + format + "\n"
@@ -85,10 +85,6 @@ func (p *Parser) errorf(format string, args ...interface{}) {
}
}
func (p *Parser) pos() src.XPos {
return p.ctxt.PosTable.XPos(src.MakePos(p.lex.Base(), uint(p.lineNum), 0))
}
func (p *Parser) Parse() (*obj.Prog, bool) {
for p.line() {
}
@@ -109,6 +105,7 @@ func (p *Parser) line() bool {
// are labeled with this line. Otherwise we complain after we've absorbed
// the terminating newline and the line numbers are off by one in errors.
p.lineNum = p.lex.Line()
p.histLineNum = lex.HistLine()
switch tok {
case '\n', ';':
continue
@@ -424,7 +421,7 @@ func (p *Parser) atStartOfRegister(name string) bool {
// We have consumed the register or R prefix.
func (p *Parser) atRegisterShift() bool {
// ARM only.
if !p.arch.InFamily(sys.ARM, sys.ARM64) {
if p.arch.Family != sys.ARM {
return false
}
// R1<<...
@@ -506,7 +503,7 @@ func (p *Parser) register(name string, prefix rune) (r1, r2 int16, scale int8, o
return r1, r2, scale, true
}
// registerShift parses an ARM/ARM64 shifted register reference and returns the encoded representation.
// registerShift parses an ARM shifted register reference and returns the encoded representation.
// There is known to be a register (current token) and a shift operator (peeked token).
func (p *Parser) registerShift(name string, prefix rune) int64 {
if prefix != 0 {
@@ -531,8 +528,6 @@ func (p *Parser) registerShift(name string, prefix rune) int64 {
case lex.ARR:
op = 2
case lex.ROT:
// following instructions on ARM64 support rotate right
// AND, ANDS, TST, BIC, BICS, EON, EOR, ORR, MVN, ORN
op = 3
}
tok := p.next()
@@ -540,37 +535,22 @@ func (p *Parser) registerShift(name string, prefix rune) int64 {
var count int16
switch tok.ScanToken {
case scanner.Ident:
if p.arch.Family == sys.ARM64 {
p.errorf("rhs of shift must be integer: %s", str)
} else {
r2, ok := p.registerReference(str)
if !ok {
p.errorf("rhs of shift must be register or integer: %s", str)
}
count = (r2&15)<<8 | 1<<4
r2, ok := p.registerReference(str)
if !ok {
p.errorf("rhs of shift must be register or integer: %s", str)
}
count = (r2&15)<<8 | 1<<4
case scanner.Int, '(':
p.back()
x := int64(p.expr())
if p.arch.Family == sys.ARM64 {
if x >= 64 {
p.errorf("register shift count too large: %s", str)
}
count = int16((x & 63) << 10)
} else {
if x >= 32 {
p.errorf("register shift count too large: %s", str)
}
count = int16((x & 31) << 7)
if x >= 32 {
p.errorf("register shift count too large: %s", str)
}
count = int16((x & 31) << 7)
default:
p.errorf("unexpected %s in register shift", tok.String())
}
if p.arch.Family == sys.ARM64 {
return int64(int64(r1&31)<<16 | int64(op)<<22 | int64(uint16(count)))
} else {
return int64((r1 & 15) | op<<5 | count)
}
return int64((r1 & 15) | op<<5 | count)
}
// symbolReference parses a symbol that is known not to be a register.
@@ -585,20 +565,16 @@ func (p *Parser) symbolReference(a *obj.Addr, name string, prefix rune) {
a.Type = obj.TYPE_INDIR
}
// Weirdness with statics: Might now have "<>".
isStatic := false
isStatic := 0 // TODO: Really a boolean, but Linklookup wants a "version" integer.
if p.peek() == '<' {
isStatic = true
isStatic = 1
p.next()
p.get('>')
}
if p.peek() == '+' || p.peek() == '-' {
a.Offset = int64(p.expr())
}
if isStatic {
a.Sym = p.ctxt.LookupStatic(name)
} else {
a.Sym = p.ctxt.Lookup(name)
}
a.Sym = obj.Linklookup(p.ctxt, name, isStatic)
if p.peek() == scanner.EOF {
if prefix == 0 && p.isJump {
// Symbols without prefix or suffix are jump labels.
@@ -611,7 +587,7 @@ func (p *Parser) symbolReference(a *obj.Addr, name string, prefix rune) {
p.get('(')
reg := p.get(scanner.Ident).String()
p.get(')')
p.setPseudoRegister(a, reg, isStatic, prefix)
p.setPseudoRegister(a, reg, isStatic != 0, prefix)
}
// setPseudoRegister sets the NAME field of addr for a pseudo-register reference such as (SB).

View File

@@ -56,6 +56,7 @@ func TestErroneous(t *testing.T) {
for _, test := range tests {
parser.errorCount = 0
parser.lineNum++
parser.histLineNum++
if !parser.pseudo(test.pseudo, tokenize(test.operands)) {
t.Fatalf("Wrong pseudo-instruction: %s", test.pseudo)
}

View File

@@ -2,9 +2,7 @@
// the old assembler's (8a's) grammar and hand-writing complete
// instructions for each rule, to guarantee we cover the same space.
#include "../../../../../runtime/textflag.h"
TEXT foo(SB), DUPOK|NOSPLIT, $0
TEXT foo(SB), 7, $0
// LTYPE1 nonrem { outcode(int($1), &$2); }
SETCC AX

View File

@@ -6,9 +6,7 @@
// the old assembler's (6a's) grammar and hand-writing complete
// instructions for each rule, to guarantee we cover the same space.
#include "../../../../../runtime/textflag.h"
TEXT foo(SB), DUPOK|NOSPLIT, $0
TEXT foo(SB), 7, $0
// LTYPE1 nonrem { outcode($1, &$2); }
NEGQ R11

View File

@@ -1,9 +1,7 @@
// generated by x86test -amd64
// DO NOT EDIT
#include "../../../../../runtime/textflag.h"
TEXT asmtest(SB),DUPOK|NOSPLIT,$0
TEXT asmtest(SB),7,$0
ADCB $7, AL // 1407
ADCW $61731, AX // 661523f1
ADCL $4045620583, AX // 15674523f1
@@ -80,10 +78,10 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
ADCQ (R11), DX // 491313
ADCQ (BX), R11 // 4c131b
ADCQ (R11), R11 // 4d131b
ADCB (BX), DL // 1213
ADCB (R11), DL // 411213
ADCB (BX), R11 // 44121b
ADCB (R11), R11 // 45121b
//TODO: ADCB (BX), DL // 1213
//TODO: ADCB (R11), DL // 411213
//TODO: ADCB (BX), R11 // 44121b
//TODO: ADCB (R11), R11 // 45121b
//TODO: ADCXL (BX), DX // 660f38f613
//TODO: ADCXL (R11), DX // 66410f38f613
//TODO: ADCXL DX, DX // 660f38f6d2
@@ -412,14 +410,14 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
ANDPD (R11), X11 // 66450f541b
ANDPD X2, X11 // 66440f54da
ANDPD X11, X11 // 66450f54db
ANDPS (BX), X2 // 0f5413
ANDPS (R11), X2 // 410f5413
ANDPS X2, X2 // 0f54d2
ANDPS X11, X2 // 410f54d3
ANDPS (BX), X11 // 440f541b
ANDPS (R11), X11 // 450f541b
ANDPS X2, X11 // 440f54da
ANDPS X11, X11 // 450f54db
//TODO: ANDPS (BX), X2 // 0f5413
//TODO: ANDPS (R11), X2 // 410f5413
//TODO: ANDPS X2, X2 // 0f54d2
//TODO: ANDPS X11, X2 // 410f54d3
//TODO: ANDPS (BX), X11 // 440f541b
//TODO: ANDPS (R11), X11 // 450f541b
//TODO: ANDPS X2, X11 // 440f54da
//TODO: ANDPS X11, X11 // 450f54db
BEXTRL R9, (BX), DX // c4e230f713
BEXTRL R9, (R11), DX // c4c230f713
BEXTRL R9, DX, DX // c4e230f7d2
@@ -1242,41 +1240,41 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
CMPB DL, (R11) // 413a13
CMPB R11, (BX) // 443a1b
CMPB R11, (R11) // 453a1b
CMPPD (BX), X2, $7 // 660fc21307
CMPPD (R11), X2, $7 // 66410fc21307
CMPPD X2, X2, $7 // 660fc2d207
CMPPD X11, X2, $7 // 66410fc2d307
CMPPD (BX), X11, $7 // 66440fc21b07
CMPPD (R11), X11, $7 // 66450fc21b07
CMPPD X2, X11, $7 // 66440fc2da07
CMPPD X11, X11, $7 // 66450fc2db07
CMPPS (BX), X2, $7 // 0fc21307
CMPPS (R11), X2, $7 // 410fc21307
CMPPS X2, X2, $7 // 0fc2d207
CMPPS X11, X2, $7 // 410fc2d307
CMPPS (BX), X11, $7 // 440fc21b07
CMPPS (R11), X11, $7 // 450fc21b07
CMPPS X2, X11, $7 // 440fc2da07
CMPPS X11, X11, $7 // 450fc2db07
//TODO: CMPPD $7, X2, (BX) // 660fc21307
//TODO: CMPPD $7, X2, (R11) // 66410fc21307
//TODO: CMPPD $7, X2, X2 // 660fc2d207
//TODO: CMPPD $7, X2, X11 // 66410fc2d307
//TODO: CMPPD $7, X11, (BX) // 66440fc21b07
//TODO: CMPPD $7, X11, (R11) // 66450fc21b07
//TODO: CMPPD $7, X11, X2 // 66440fc2da07
//TODO: CMPPD $7, X11, X11 // 66450fc2db07
//TODO: CMPPS $7, X2, (BX) // 0fc21307
//TODO: CMPPS $7, X2, (R11) // 410fc21307
//TODO: CMPPS $7, X2, X2 // 0fc2d207
//TODO: CMPPS $7, X2, X11 // 410fc2d307
//TODO: CMPPS $7, X11, (BX) // 440fc21b07
//TODO: CMPPS $7, X11, (R11) // 450fc21b07
//TODO: CMPPS $7, X11, X2 // 440fc2da07
//TODO: CMPPS $7, X11, X11 // 450fc2db07
CMPSB // a6
CMPSL // a7
CMPSD (BX), X2, $7 // f20fc21307
CMPSD (R11), X2, $7 // f2410fc21307
CMPSD X2, X2, $7 // f20fc2d207
CMPSD X11, X2, $7 // f2410fc2d307
CMPSD (BX), X11, $7 // f2440fc21b07
CMPSD (R11), X11, $7 // f2450fc21b07
CMPSD X2, X11, $7 // f2440fc2da07
CMPSD X11, X11, $7 // f2450fc2db07
//TODO: CMPSD $7, X2, (BX) // f20fc21307
//TODO: CMPSD $7, X2, (R11) // f2410fc21307
//TODO: CMPSD $7, X2, X2 // f20fc2d207
//TODO: CMPSD $7, X2, X11 // f2410fc2d307
//TODO: CMPSD $7, X11, (BX) // f2440fc21b07
//TODO: CMPSD $7, X11, (R11) // f2450fc21b07
//TODO: CMPSD $7, X11, X2 // f2440fc2da07
//TODO: CMPSD $7, X11, X11 // f2450fc2db07
CMPSQ // 48a7
CMPSS (BX), X2, $7 // f30fc21307
CMPSS (R11), X2, $7 // f3410fc21307
CMPSS X2, X2, $7 // f30fc2d207
CMPSS X11, X2, $7 // f3410fc2d307
CMPSS (BX), X11, $7 // f3440fc21b07
CMPSS (R11), X11, $7 // f3450fc21b07
CMPSS X2, X11, $7 // f3440fc2da07
CMPSS X11, X11, $7 // f3450fc2db07
//TODO: CMPSS $7, X2, (BX) // f30fc21307
//TODO: CMPSS $7, X2, (R11) // f3410fc21307
//TODO: CMPSS $7, X2, X2 // f30fc2d207
//TODO: CMPSS $7, X2, X11 // f3410fc2d307
//TODO: CMPSS $7, X11, (BX) // f3440fc21b07
//TODO: CMPSS $7, X11, (R11) // f3450fc21b07
//TODO: CMPSS $7, X11, X2 // f3440fc2da07
//TODO: CMPSS $7, X11, X11 // f3450fc2db07
CMPSW // 66a7
CMPXCHGW DX, (BX) // 660fb113
CMPXCHGW R11, (BX) // 66440fb11b
@@ -2687,18 +2685,18 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
MOVQOZX M3, X11 // f3440fd6db
MOVSB // a4
MOVSL // a5
MOVSD (BX), X2 // f20f1013
MOVSD (R11), X2 // f2410f1013
MOVSD X2, X2 // f20f10d2 or f20f11d2
MOVSD X11, X2 // f2410f10d3 or f2440f11da
MOVSD (BX), X11 // f2440f101b
MOVSD (R11), X11 // f2450f101b
MOVSD X2, X11 // f2440f10da or f2410f11d3
MOVSD X11, X11 // f2450f10db or f2450f11db
MOVSD X2, (BX) // f20f1113
MOVSD X11, (BX) // f2440f111b
MOVSD X2, (R11) // f2410f1113
MOVSD X11, (R11) // f2450f111b
//TODO: MOVSD (BX), X2 // f20f1013
//TODO: MOVSD (R11), X2 // f2410f1013
//TODO: MOVSD X2, X2 // f20f10d2 or f20f11d2
//TODO: MOVSD X11, X2 // f2410f10d3 or f2440f11da
//TODO: MOVSD (BX), X11 // f2440f101b
//TODO: MOVSD (R11), X11 // f2450f101b
//TODO: MOVSD X2, X11 // f2440f10da or f2410f11d3
//TODO: MOVSD X11, X11 // f2450f10db or f2450f11db
//TODO: MOVSD X2, (BX) // f20f1113
//TODO: MOVSD X11, (BX) // f2440f111b
//TODO: MOVSD X2, (R11) // f2410f1113
//TODO: MOVSD X11, (R11) // f2450f111b
MOVSHDUP (BX), X2 // f30f1613
MOVSHDUP (R11), X2 // f3410f1613
MOVSHDUP X2, X2 // f30f16d2

File diff suppressed because it is too large Load Diff

View File

@@ -6,9 +6,7 @@
// the old assembler's (7a's) grammar and hand-writing complete
// instructions for each rule, to guarantee we cover the same space.
#include "../../../../../runtime/textflag.h"
TEXT foo(SB), DUPOK|NOSPLIT, $-8
TEXT foo(SB), 7, $-8
//
// ADD
@@ -18,6 +16,7 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
// outcode($1, &$2, $4, &$6);
// }
// imsr comes from the old 7a, we only support immediates and registers
// at the moment, no shifted registers.
ADDW $1, R2, R3
ADDW R1, R2, R3
ADDW R1, ZR, R3
@@ -25,10 +24,6 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
ADD R1, R2, R3
ADD R1, ZR, R3
ADD $1, R2, R3
ADD R1>>11, R2, R3
ADD R1<<22, R2, R3
ADD R1->33, R2, R3
AND R1@>33, R2, R3
// LTYPE1 imsr ',' spreg ','
// {
@@ -42,19 +37,6 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
ADDW R1, R2
ADD $1, R2
ADD R1, R2
ADD R1>>11, R2
ADD R1<<22, R2
ADD R1->33, R2
AND R1@>33, R2
// logical ops
// make sure constants get encoded into an instruction when it could
AND $(1<<63), R1 // AND $-9223372036854775808, R1 // 21004192
AND $(1<<63-1), R1 // AND $9223372036854775807, R1 // 21f84092
ORR $(1<<63), R1 // ORR $-9223372036854775808, R1 // 210041b2
ORR $(1<<63-1), R1 // ORR $9223372036854775807, R1 // 21f840b2
EOR $(1<<63), R1 // EOR $-9223372036854775808, R1 // 210041d2
EOR $(1<<63-1), R1 // EOR $9223372036854775807, R1 // 21f840d2
//
// CLS
@@ -85,60 +67,6 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
MOVD $1, R1
MOVD ZR, (R1)
// small offset fits into instructions
MOVB 1(R1), R2 // 22048039
MOVH 1(R1), R2 // 22108078
MOVH 2(R1), R2 // 22048079
MOVW 1(R1), R2 // 221080b8
MOVW 4(R1), R2 // 220480b9
MOVD 1(R1), R2 // 221040f8
MOVD 8(R1), R2 // 220440f9
FMOVS 1(R1), F2 // 221040bc
FMOVS 4(R1), F2 // 220440bd
FMOVD 1(R1), F2 // 221040fc
FMOVD 8(R1), F2 // 220440fd
MOVB R1, 1(R2) // 41040039
MOVH R1, 1(R2) // 41100078
MOVH R1, 2(R2) // 41040079
MOVW R1, 1(R2) // 411000b8
MOVW R1, 4(R2) // 410400b9
MOVD R1, 1(R2) // 411000f8
MOVD R1, 8(R2) // 410400f9
FMOVS F1, 1(R2) // 411000bc
FMOVS F1, 4(R2) // 410400bd
FMOVD F1, 1(R2) // 411000fc
FMOVD F1, 8(R2) // 410400fd
// large aligned offset, use two instructions
MOVB 0x1001(R1), R2 // MOVB 4097(R1), R2 // 3b04409162078039
MOVH 0x2002(R1), R2 // MOVH 8194(R1), R2 // 3b08409162078079
MOVW 0x4004(R1), R2 // MOVW 16388(R1), R2 // 3b104091620780b9
MOVD 0x8008(R1), R2 // MOVD 32776(R1), R2 // 3b204091620740f9
FMOVS 0x4004(R1), F2 // FMOVS 16388(R1), F2 // 3b104091620740bd
FMOVD 0x8008(R1), F2 // FMOVD 32776(R1), F2 // 3b204091620740fd
MOVB R1, 0x1001(R2) // MOVB R1, 4097(R2) // 5b04409161070039
MOVH R1, 0x2002(R2) // MOVH R1, 8194(R2) // 5b08409161070079
MOVW R1, 0x4004(R2) // MOVW R1, 16388(R2) // 5b104091610700b9
MOVD R1, 0x8008(R2) // MOVD R1, 32776(R2) // 5b204091610700f9
FMOVS F1, 0x4004(R2) // FMOVS F1, 16388(R2) // 5b104091610700bd
FMOVD F1, 0x8008(R2) // FMOVD F1, 32776(R2) // 5b204091610700fd
// very large or unaligned offset uses constant pool
// the encoding cannot be checked as the address of the constant pool is unknown.
// here we only test that they can be assembled.
MOVB 0x44332211(R1), R2 // MOVB 1144201745(R1), R2
MOVH 0x44332211(R1), R2 // MOVH 1144201745(R1), R2
MOVW 0x44332211(R1), R2 // MOVW 1144201745(R1), R2
MOVD 0x44332211(R1), R2 // MOVD 1144201745(R1), R2
FMOVS 0x44332211(R1), F2 // FMOVS 1144201745(R1), F2
FMOVD 0x44332211(R1), F2 // FMOVD 1144201745(R1), F2
MOVB R1, 0x44332211(R2) // MOVB R1, 1144201745(R2)
MOVH R1, 0x44332211(R2) // MOVH R1, 1144201745(R2)
MOVW R1, 0x44332211(R2) // MOVW R1, 1144201745(R2)
MOVD R1, 0x44332211(R2) // MOVD R1, 1144201745(R2)
FMOVS F1, 0x44332211(R2) // FMOVS F1, 1144201745(R2)
FMOVD F1, 0x44332211(R2) // FMOVD F1, 1144201745(R2)
//
// MOVK
//
@@ -190,9 +118,7 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
// }
CMP $3, R2
CMP R1, R2
CMP R1->11, R2
CMP R1>>22, R2
CMP R1<<33, R2
//
// CBZ
//
@@ -210,7 +136,7 @@ again:
// {
// outcode($1, &$2, NREG, &$4);
// }
CSET GT, R1 // e1d79f9a
CSET GT, R1
//
// CSEL/CSINC/CSNEG/CSINV
//
@@ -218,18 +144,16 @@ again:
// {
// outgcode($1, &$2, $6.reg, &$4, &$8);
// }
CSEL LT, R1, R2, ZR // 3fb0829a
CSINC GT, R1, ZR, R3 // 23c49f9a
CSNEG MI, R1, R2, R3 // 234482da
CSINV CS, R1, R2, R3 // CSINV HS, R1, R2, R3 // 232082da
CSEL LT, R1, R2, ZR
CSINC GT, R1, ZR, R3
CSNEG MI, R1, R2, R3
CSINV CS, R1, R2, R3 // CSINV HS, R1, R2, R3
// LTYPES cond ',' reg ',' reg
// {
// outcode($1, &$2, $4.reg, &$6);
// }
CINC EQ, R4, R9 // 8914849a
CINV PL, R11, R22 // 76418bda
CNEG LS, R13, R7 // a7858dda
CSEL LT, R1, R2
//
// CCMN
//
@@ -237,7 +161,7 @@ again:
// {
// outgcode($1, &$2, $6.reg, &$4, &$8);
// }
CCMN MI, ZR, R1, $4 // e44341ba
CCMN MI, ZR, R1, $4
//
// FADDD
@@ -273,7 +197,7 @@ again:
// {
// outgcode($1, &$2, $6.reg, &$4, &$8);
// }
FCCMPS LT, F1, F2, $1 // 41b4211e
// FCCMP LT, F1, F2, $1
//
// FMULA
@@ -333,8 +257,6 @@ again:
B foo(SB) // JMP foo(SB)
BL foo(SB) // CALL foo(SB)
BEQ 2(PC)
TBZ $1, R1, 2(PC)
TBNZ $2, R2, 2(PC)
JMP foo(SB)
CALL foo(SB)

View File

@@ -1,102 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
TEXT errors(SB),$0
MULS.S R1, R2, R3, R4 // ERROR "invalid .S suffix"
ADD.P R1, R2, R3 // ERROR "invalid .P suffix"
SUB.W R2, R3 // ERROR "invalid .W suffix"
BL 4(R4) // ERROR "non-zero offset"
ADDF F0, R1, F2 // ERROR "illegal combination"
SWI (R0) // ERROR "illegal combination"
NEGF F0, F1, F2 // ERROR "illegal combination"
NEGD F0, F1, F2 // ERROR "illegal combination"
ABSF F0, F1, F2 // ERROR "illegal combination"
ABSD F0, F1, F2 // ERROR "illegal combination"
SQRTF F0, F1, F2 // ERROR "illegal combination"
SQRTD F0, F1, F2 // ERROR "illegal combination"
MOVF F0, F1, F2 // ERROR "illegal combination"
MOVD F0, F1, F2 // ERROR "illegal combination"
MOVDF F0, F1, F2 // ERROR "illegal combination"
MOVFD F0, F1, F2 // ERROR "illegal combination"
MOVM.IA 4(R1), [R0-R4] // ERROR "offset must be zero"
MOVM.DA 4(R1), [R0-R4] // ERROR "offset must be zero"
MOVM.IB 4(R1), [R0-R4] // ERROR "offset must be zero"
MOVM.DB 4(R1), [R0-R4] // ERROR "offset must be zero"
MOVM.IA [R0-R4], 4(R1) // ERROR "offset must be zero"
MOVM.DA [R0-R4], 4(R1) // ERROR "offset must be zero"
MOVM.IB [R0-R4], 4(R1) // ERROR "offset must be zero"
MOVM.DB [R0-R4], 4(R1) // ERROR "offset must be zero"
MOVW CPSR, FPSR // ERROR "illegal combination"
MOVW FPSR, CPSR // ERROR "illegal combination"
MOVW CPSR, errors(SB) // ERROR "illegal combination"
MOVW errors(SB), CPSR // ERROR "illegal combination"
MOVW FPSR, errors(SB) // ERROR "illegal combination"
MOVW errors(SB), FPSR // ERROR "illegal combination"
MOVW F0, errors(SB) // ERROR "illegal combination"
MOVW errors(SB), F0 // ERROR "illegal combination"
MOVW $20, errors(SB) // ERROR "illegal combination"
MOVW errors(SB), $20 // ERROR "illegal combination"
MOVB $245, R1 // ERROR "illegal combination"
MOVH $245, R1 // ERROR "illegal combination"
MOVB $0xff000000, R1 // ERROR "illegal combination"
MOVH $0xff000000, R1 // ERROR "illegal combination"
MOVB $0x00ffffff, R1 // ERROR "illegal combination"
MOVH $0x00ffffff, R1 // ERROR "illegal combination"
MOVB FPSR, g // ERROR "illegal combination"
MOVH FPSR, g // ERROR "illegal combination"
MOVB g, FPSR // ERROR "illegal combination"
MOVH g, FPSR // ERROR "illegal combination"
MOVB CPSR, g // ERROR "illegal combination"
MOVH CPSR, g // ERROR "illegal combination"
MOVB g, CPSR // ERROR "illegal combination"
MOVH g, CPSR // ERROR "illegal combination"
MOVB $0xff000000, CPSR // ERROR "illegal combination"
MOVH $0xff000000, CPSR // ERROR "illegal combination"
MOVB $0xff000000, FPSR // ERROR "illegal combination"
MOVH $0xff000000, FPSR // ERROR "illegal combination"
MOVB $0xffffff00, CPSR // ERROR "illegal combination"
MOVH $0xffffff00, CPSR // ERROR "illegal combination"
MOVB $0xfffffff0, FPSR // ERROR "illegal combination"
MOVH $0xfffffff0, FPSR // ERROR "illegal combination"
MOVB.IA 4(R1), [R0-R4] // ERROR "illegal combination"
MOVB.DA 4(R1), [R0-R4] // ERROR "illegal combination"
MOVH.IA 4(R1), [R0-R4] // ERROR "illegal combination"
MOVH.DA 4(R1), [R0-R4] // ERROR "illegal combination"
MOVB $0xff(R0), R1 // ERROR "illegal combination"
MOVH $0xff(R0), R1 // ERROR "illegal combination"
MOVB $errors(SB), R2 // ERROR "illegal combination"
MOVH $errors(SB), R2 // ERROR "illegal combination"
MOVB F0, R0 // ERROR "illegal combination"
MOVH F0, R0 // ERROR "illegal combination"
MOVB R0, F0 // ERROR "illegal combination"
MOVH R0, F0 // ERROR "illegal combination"
MOVB R0>>0(R1), R2 // ERROR "bad shift"
MOVB R0->0(R1), R2 // ERROR "bad shift"
MOVB R0@>0(R1), R2 // ERROR "bad shift"
MOVBS R0>>0(R1), R2 // ERROR "bad shift"
MOVBS R0->0(R1), R2 // ERROR "bad shift"
MOVBS R0@>0(R1), R2 // ERROR "bad shift"
MOVF CPSR, F1 // ERROR "illegal combination"
MOVD R1, CPSR // ERROR "illegal combination"
MOVW F1, F2 // ERROR "illegal combination"
MOVB F1, F2 // ERROR "illegal combination"
MOVH F1, F2 // ERROR "illegal combination"
MOVF R1, F2 // ERROR "illegal combination"
MOVD R1, F2 // ERROR "illegal combination"
MOVF R1, R1 // ERROR "illegal combination"
MOVD R1, R2 // ERROR "illegal combination"
MOVFW R1, R2 // ERROR "illegal combination"
MOVDW R1, R2 // ERROR "illegal combination"
MOVWF R1, R2 // ERROR "illegal combination"
MOVWD R1, R2 // ERROR "illegal combination"
MOVWD CPSR, R2 // ERROR "illegal combination"
MOVWF CPSR, R2 // ERROR "illegal combination"
MOVWD R1, CPSR // ERROR "illegal combination"
MOVWF R1, CPSR // ERROR "illegal combination"
MOVDW CPSR, R2 // ERROR "illegal combination"
MOVFW CPSR, R2 // ERROR "illegal combination"
MOVDW R1, CPSR // ERROR "illegal combination"
MOVFW R1, CPSR // ERROR "illegal combination"
END

View File

@@ -1,90 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
#include "../../../../../runtime/textflag.h"
TEXT foo(SB), DUPOK|NOSPLIT, $0
ADDF F0, F1, F2 // 002a31ee
ADDD.EQ F3, F4, F5 // 035b340e
ADDF.NE F0, F2 // 002a321e
ADDD F3, F5 // 035b35ee
SUBF F0, F1, F2 // 402a31ee
SUBD.EQ F3, F4, F5 // 435b340e
SUBF.NE F0, F2 // 402a321e
SUBD F3, F5 // 435b35ee
MULF F0, F1, F2 // 002a21ee
MULD.EQ F3, F4, F5 // 035b240e
MULF.NE F0, F2 // 002a221e
MULD F3, F5 // 035b25ee
DIVF F0, F1, F2 // 002a81ee
DIVD.EQ F3, F4, F5 // 035b840e
DIVF.NE F0, F2 // 002a821e
DIVD F3, F5 // 035b85ee
NEGF F0, F1 // 401ab1ee
NEGD F4, F5 // 445bb1ee
ABSF F0, F1 // c01ab0ee
ABSD F4, F5 // c45bb0ee
SQRTF F0, F1 // c01ab1ee
SQRTD F4, F5 // c45bb1ee
MOVFD F0, F1 // c01ab7ee
MOVDF F4, F5 // c45bb7ee
LDREX (R8), R9 // 9f9f98e1
LDREXD (R11), R12 // 9fcfbbe1
STREX R3, (R4), R5 // STREX (R4), R3, R5 // 935f84e1
STREXD R8, (R9), g // STREXD (R9), R8, g // 98afa9e1
CMPF F8, F9 // c89ab4ee10faf1ee
CMPD.CS F4, F5 // c45bb42e10faf12e
CMPF.VS F7 // c07ab56e10faf16e
CMPD F6 // c06bb5ee10faf1ee
MOVW R4, F8 // 104b08ee
MOVW F4, R8 // 108b14ee
MOVF (R4), F9 // 009a94ed
MOVD.EQ (R4), F9 // 009b940d
MOVF.NE (g), F3 // 003a9a1d
MOVD (g), F3 // 003b9aed
MOVF 0x20(R3), F9 // MOVF 32(R3), F9 // 089a93ed
MOVD.EQ 0x20(R4), F9 // MOVD.EQ 32(R4), F9 // 089b940d
MOVF.NE -0x20(g), F3 // MOVF.NE -32(g), F3 // 083a1a1d
MOVD -0x20(g), F3 // MOVD -32(g), F3 // 083b1aed
MOVF F9, (R4) // 009a84ed
MOVD.EQ F9, (R4) // 009b840d
MOVF.NE F3, (g) // 003a8a1d
MOVD F3, (g) // 003b8aed
MOVF F9, 0x20(R3) // MOVF F9, 32(R3) // 089a83ed
MOVD.EQ F9, 0x20(R4) // MOVD.EQ F9, 32(R4) // 089b840d
MOVF.NE F3, -0x20(g) // MOVF.NE F3, -32(g) // 083a0a1d
MOVD F3, -0x20(g) // MOVD F3, -32(g) // 083b0aed
MOVF 0x00ffffff(R2), F1 // MOVF 16777215(R2), F1
MOVD 0x00ffffff(R2), F1 // MOVD 16777215(R2), F1
MOVF F2, 0x00ffffff(R2) // MOVF F2, 16777215(R2)
MOVD F2, 0x00ffffff(R2) // MOVD F2, 16777215(R2)
MOVF F0, math·Exp(SB) // MOVF F0, math.Exp(SB)
MOVF math·Exp(SB), F0 // MOVF math.Exp(SB), F0
MOVD F0, math·Exp(SB) // MOVD F0, math.Exp(SB)
MOVD math·Exp(SB), F0 // MOVD math.Exp(SB), F0
MOVF F4, F5 // 445ab0ee
MOVD F6, F7 // 467bb0ee
MOVFW F6, F8 // c68abdee
MOVFW F6, R8 // c6fabdee108b1fee
MOVFW.U F6, F8 // c68abcee
MOVFW.U F6, R8 // c6fabcee108b1fee
MOVDW F6, F8 // c68bbdee
MOVDW F6, R8 // c6fbbdee108b1fee
MOVDW.U F6, F8 // c68bbcee
MOVDW.U F6, R8 // c6fbbcee108b1fee
MOVWF F6, F8 // c68ab8ee
MOVWF R6, F8 // 106b0feecf8ab8ee
MOVWF.U F6, F8 // 468ab8ee
MOVWF.U R6, F8 // 106b0fee4f8ab8ee
MOVWD F6, F8 // c68bb8ee
MOVWD R6, F8 // 106b0feecf8bb8ee
MOVWD.U F6, F8 // 468bb8ee
MOVWD.U R6, F8 // 106b0fee4f8bb8ee
END

View File

@@ -5,9 +5,7 @@
// This input was created by taking the mips64 testcase and modified
// by hand.
#include "../../../../../runtime/textflag.h"
TEXT foo(SB),DUPOK|NOSPLIT,$0
TEXT foo(SB),7,$0
//inst:
//

View File

@@ -5,9 +5,7 @@
// This input was created by taking the ppc64 testcase and modified
// by hand.
#include "../../../../../runtime/textflag.h"
TEXT foo(SB),DUPOK|NOSPLIT,$0
TEXT foo(SB),7,$0
//inst:
//
@@ -39,9 +37,6 @@ TEXT foo(SB),DUPOK|NOSPLIT,$0
MOVV 16(R1), R2
MOVV (R1), R2
LL (R1), R2 // c0220000
LLV (R1), R2 // d0220000
// LMOVB rreg ',' rreg
// {
// outcode(int($1), &$2, 0, &$4);
@@ -101,9 +96,6 @@ TEXT foo(SB),DUPOK|NOSPLIT,$0
MOVV R1, 16(R2)
MOVV R1, (R2)
SC R1, (R2) // e0410000
SCV R1, (R2) // f0410000
// LMOVB rreg ',' addr
// {
// outcode(int($1), &$2, 0, &$4);
@@ -244,11 +236,11 @@ TEXT foo(SB),DUPOK|NOSPLIT,$0
label0:
JMP 1(PC)
BEQ R1, 2(PC)
JMP label0+0 // JMP 68
JMP label0+0 // JMP 64
BEQ R1, 2(PC)
JAL 1(PC) // CALL 1(PC)
BEQ R1, 2(PC)
JAL label0+0 // CALL 68
JAL label0+0 // CALL 64
// LBRA addr
// {
@@ -272,7 +264,7 @@ label0:
// }
label1:
BEQ R1, 1(PC)
BEQ R1, label1 // BEQ R1, 83
BEQ R1, label1 // BEQ R1, 79
// LBRA rreg ',' sreg ',' rel
// {
@@ -280,7 +272,7 @@ label1:
// }
label2:
BEQ R1, R2, 1(PC)
BEQ R1, R2, label2 // BEQ R1, R2, 85
BEQ R1, R2, label2 // BEQ R1, R2, 81
//
// other integer conditional branch
@@ -291,7 +283,7 @@ label2:
// }
label3:
BLTZ R1, 1(PC)
BLTZ R1, label3 // BLTZ R1, 87
BLTZ R1, label3 // BLTZ R1, 83
//
// floating point conditional branch
@@ -299,7 +291,7 @@ label3:
// LBRA rel
label4:
BFPT 1(PC)
BFPT label4 // BFPT 89
BFPT label4 // BFPT 85
//
@@ -333,9 +325,7 @@ label4:
//
// WORD
//
WORD $1 // 00000001
NOOP // 00000000
SYNC // 0000000f
WORD $1
//
// NOP

Some files were not shown because too many files have changed in this diff Show More