]> Cypherpunks repositories - gostls13.git/log
gostls13.git
6 years agocmd/compile: prevent double-walk of switch for OPRINT/OPRINTN
David Chase [Mon, 17 Dec 2018 17:01:56 +0000 (12:01 -0500)]
cmd/compile: prevent double-walk of switch for OPRINT/OPRINTN

When a println arg contains a call to an inlineable function
that itself contains a switch, that switch statement will be
walked twice, once by the walkexprlist formerly in the
OPRINT/OPRINTN case, then by walkexprlistcheap in walkprint.

Remove the first walkexprlist, it is not necessary.
walkexprlist =
s[i] = walkexpr(s[i], init)
walkexprlistcheap = {
s[i] = cheapexpr(n, init)
s[i] = walkexpr(s[i], init)
}

Seems like this might be possible in other places, i.e.,
calls to inlineable switch-containing functions.

See also #25776.
Fixes #29220.

Change-Id: I3781e86aad6688711597b8bee9bc7ebd3af93601
Reviewed-on: https://go-review.googlesource.com/c/154497
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
6 years agoruntime: fix sysUsed for Windows
Michael Anthony Knyszek [Tue, 11 Dec 2018 18:26:42 +0000 (18:26 +0000)]
runtime: fix sysUsed for Windows

sysUsed on Windows cares about the result from the VirtualAlloc syscall
returning exactly the address that was passed to it. However,
VirtualAlloc aligns the address its given to the kernel's allocation
granularity, so the returned address may not be the same.

Note that this wasn't an issue in the past because we only sysUsed
regions owned by spans, and spans are always a multiple of 8K, which
is a multiple of the allocation granularity on most Windows machines.

Change-Id: I3f5ccd63c6bbbd8b7995945ecedee17573b31667
Reviewed-on: https://go-review.googlesource.com/c/153677
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Rick Hudson <rlh@golang.org>
6 years agodoc/go1.12: release notes for crypto
Filippo Valsorda [Thu, 13 Dec 2018 00:31:45 +0000 (19:31 -0500)]
doc/go1.12: release notes for crypto

Change-Id: I2a5613377a38815fb8746c5bfb07ccbbc2e6dd0b
Reviewed-on: https://go-review.googlesource.com/c/153829
Reviewed-by: Adam Langley <agl@golang.org>
6 years agodoc/go1.12: release notes for "go doc -all"
Filippo Valsorda [Thu, 13 Dec 2018 00:30:32 +0000 (19:30 -0500)]
doc/go1.12: release notes for "go doc -all"

Change-Id: If65518c76a865c03266be76b1c21c76e1c8b4763
Reviewed-on: https://go-review.googlesource.com/c/153828
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoruntime: capture pause stack for late gcWork put debugging
Austin Clements [Mon, 17 Dec 2018 19:39:05 +0000 (14:39 -0500)]
runtime: capture pause stack for late gcWork put debugging

This captures the stack trace where mark completion observed that each
P had no work, and then dumps this if that P later discovers more
work. Hopefully this will help bound where the work was created.

For #27993.

Change-Id: I4f29202880d22c433482dc1463fb50ab693b6de6
Reviewed-on: https://go-review.googlesource.com/c/154599
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
6 years agoruntime: make traceback indicate whether _defer was just allocated
Austin Clements [Mon, 17 Dec 2018 19:23:56 +0000 (14:23 -0500)]
runtime: make traceback indicate whether _defer was just allocated

Many of the crashes observed in #27993 involve committing the new
_defer object at the end of newdefer. It would be helpful to know if
the _defer was just allocated or was retrieved from the defer pool. In
order to indicate this in the traceback, this CL duplicates the tail
of newdefer so that the PC/line number will tell us whether d is new
or not.

For #27993.

Change-Id: Icd3e23dbcf00461877bb082b6f18df701149a607
Reviewed-on: https://go-review.googlesource.com/c/154598
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
6 years agoruntime: record extra information in throwOnGCWork crashes
Austin Clements [Mon, 17 Dec 2018 19:17:20 +0000 (14:17 -0500)]
runtime: record extra information in throwOnGCWork crashes

Currently we only know the slot address and the value being written in
the throwOnGCWork crash tracebacks, and we have to infer the old value
from what's dumped by gcWork.checkPut. Sometimes these old values
don't make sense, like when we see a write of a nil pointer to a
freshly-allocated object, yet we observe marking a value (where did
that pointer come from?).

This CL adds the old value of the slot and the first two pointers in
the buffer to the traceback.

For #27993.

Change-Id: Ib70eead1afb9c06e8099e520172c3a2acaa45f80
Reviewed-on: https://go-review.googlesource.com/c/154597
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
6 years agocmd: improve aix/ppc64 new symbol addressing
Clément Chigot [Wed, 28 Nov 2018 12:38:02 +0000 (13:38 +0100)]
cmd: improve aix/ppc64 new symbol addressing

This commit updates the new symbol addressing made for aix/ppc64 according
to feedbacks given in CL 151039.

Change-Id: Ic4eb9943dc520d65f7d084adf8fa9a2530f4d3f9
Reviewed-on: https://go-review.googlesource.com/c/151302
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agodoc/go1.12: updates for runtime and compiler
Austin Clements [Mon, 17 Dec 2018 20:26:36 +0000 (15:26 -0500)]
doc/go1.12: updates for runtime and compiler

Change-Id: Ifb16fd28105efd05cebbd615b52e45330b77cede
Reviewed-on: https://go-review.googlesource.com/c/154600
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/compile: generate interface method expression wrapper for error.Error
Robert Griesemer [Mon, 17 Dec 2018 19:33:42 +0000 (11:33 -0800)]
cmd/compile: generate interface method expression wrapper for error.Error

A prior optimization (https://golang.org/cl/106175) removed the
generation of unnecessary method expression wrappers, but also
eliminated the generation of the wrapper for error.Error which
was still required.

Special-case error type in the optimization.

Fixes #29304.

Change-Id: I54c8afc88a2c6d1906afa2d09c68a0a3f3e2f1e3
Reviewed-on: https://go-review.googlesource.com/c/154578
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoruntime: poison the write barrier buffer during flushing
Austin Clements [Mon, 17 Dec 2018 18:45:14 +0000 (13:45 -0500)]
runtime: poison the write barrier buffer during flushing

Currently we reset the write barrier buffer before processing the
pointers in it. As a result, if there were any write barriers in the
code that processes the buffer, it would corrupt the write barrier
buffer and cause us to mark objects without later scanning them.

As far as I can tell, this shouldn't be happening, but rather than
relying on hope (and incomplete static analysis), this CL changes
wbBufFlush1 to poison the write barrier buffer while processing it,
and only reset it once it's done.

Updates #27993. (Unlike many of the other changes for this issue,
there's no need to roll back this CL. It's a good change in its own
right.)

Change-Id: I6d2d9f1b69b89438438b9ee624f3fff9f009e29d
Reviewed-on: https://go-review.googlesource.com/c/154537
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
6 years agocmd/link: fix error messages for external linking on ppc64
Clément Chigot [Fri, 23 Nov 2018 14:16:18 +0000 (15:16 +0100)]
cmd/link: fix error messages for external linking on ppc64

This commit fixes error messages displayed on aix/ppc64 with external
linking.

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

6 years agoos: make Stat work on FAT file system
Alex Brainman [Sat, 15 Dec 2018 07:52:26 +0000 (18:52 +1100)]
os: make Stat work on FAT file system

It appears calling GetFileInformationByHandleEx with
FILE_ATTRIBUTE_TAG_INFO fails on FAT file system. FAT does not
support symlinks, so assume there are no symlnks when
GetFileInformationByHandleEx returns ERROR_INVALID_PARAMETER.

Fixes #29214

Change-Id: If2d9f3288bd99637681ab5fd4e4581c77b578a69
Reviewed-on: https://go-review.googlesource.com/c/154377
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/dist: re-enable VFPv3 on openbsd/arm
Joel Sing [Sat, 15 Dec 2018 14:07:58 +0000 (01:07 +1100)]
cmd/dist: re-enable VFPv3 on openbsd/arm

The OpenBSD armv7 port has working VFPv3 these days - re-enable the VFP
detection code so that GOARM=7 is used by default on openbsd/arm.

Change-Id: I0271d81c048d2d55becd2803c19e5f1542076357
Reviewed-on: https://go-review.googlesource.com/c/154378
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>

6 years agoruntime: fix hangs in TestDebugCall*
Austin Clements [Fri, 14 Dec 2018 16:55:44 +0000 (11:55 -0500)]
runtime: fix hangs in TestDebugCall*

This fixes a few different issues that led to hangs and general
flakiness in the TestDebugCall* tests.

1. This fixes missing wake-ups in two error paths of the SIGTRAP
   signal handler. If the goroutine was in an unknown state, or if
   there was an unknown debug call status, we currently don't wake the
   injection coordinator. These are terminal states, so this resulted
   in a hang.

2. This adds a retry if the target goroutine is in a transient state
   that prevents us from injecting a call. The most common failure
   mode here is that the target goroutine is in _Grunnable, but this
   was previously masked because it deadlocked the test.

3. Related to 2, this switches the "ready" signal from the target
   goroutine from a blocking channel send to a non-blocking channel
   send. This makes it much less likely that we'll catch this
   goroutine while it's in the runtime performing that send.

4. This increases GOMAXPROCS from 2 to 8 during these tests. With the
   current setting of 2, we can have at most the non-preemptible
   goroutine we're injecting a call in to and the goroutine that's
   trying to make it exit. If anything else comes along, it can
   deadlock. One particular case I observed was in TestDebugCallGC,
   where runtime.GC() returns before the forEachP that prepares
   sweeping on all goroutines has finished. When this happens, the
   forEachP blocks on the non-preemptible loop, which means we now
   have at least three goroutines that need to run.

Fixes #25519.

Updates #29124.

Change-Id: I7bc41dc0b865b7d0bb379cb654f9a1218bc37428
Reviewed-on: https://go-review.googlesource.com/c/154112
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
6 years agogo/doc: handle Examples with no body
Agniva De Sarker [Sun, 16 Dec 2018 13:43:25 +0000 (19:13 +0530)]
go/doc: handle Examples with no body

Fixes #29271

Change-Id: Iff6a16c659ad6ec1b4d9559fcbcd40196086c60e
Reviewed-on: https://go-review.googlesource.com/c/154380
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
6 years agocmd/fix,cmd/cgo,misc/cgo: map the EGLDisplay C type to uintptr in Go
Elias Naur [Sat, 15 Dec 2018 16:03:37 +0000 (17:03 +0100)]
cmd/fix,cmd/cgo,misc/cgo: map the EGLDisplay C type to uintptr in Go

Similar to to macOS' CF* types and JNI's jobject and derived types,
the EGLDisplay type is declared as a pointer but can contain
non-pointers (see #27054).
Fix it the same way: map EGLDisplay to uintptr in Go.

Fixes #27054

RELNOTE=yes

Change-Id: I6136f8f8162687c5493b30ed324e29efe55a8fd7
Reviewed-on: https://go-review.googlesource.com/c/154417
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
6 years agocmd/nm: report windows/arm as relocatable in TestGoExec
Jordan Rhee [Sat, 15 Dec 2018 00:11:03 +0000 (16:11 -0800)]
cmd/nm: report windows/arm as relocatable in TestGoExec

Updates #26148

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

6 years agocmd/link: fix in-package syso linking
Shenghou Ma [Fri, 14 Dec 2018 04:55:22 +0000 (23:55 -0500)]
cmd/link: fix in-package syso linking

CL 146297 ignored archive members with short names that don't have
the .o suffix, however, it also ignored .syso files as well.
This change restores the original .syso behavior and adds a test.

As the test is basically following a shell script, we make use of
the existing cmd/go/testdata/script framework. To support running
C compiler in the script, we added a `cc` command, which runs the
C compiler along with correct platform specific arguments.

Fixes #29253.

Change-Id: If8520151c4d6a74ab9fe84d34bff9a4480688815
Reviewed-on: https://go-review.googlesource.com/c/154109
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
6 years agocmd/go/internal/cache: save more data from DefaultDir
Bryan C. Mills [Fri, 14 Dec 2018 21:59:04 +0000 (16:59 -0500)]
cmd/go/internal/cache: save more data from DefaultDir

cmd/go/main.go sets GOCACHE explicitly, so if we don't save some
metadata about how DefaultDir arrived at its answer we will be unable
to reconstruct it later.

Fixes #29243

Change-Id: Ic8bb859ab045a29c91f6a4527e65aedabf874d53
Reviewed-on: https://go-review.googlesource.com/c/154309
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
6 years agodoc: document Go 1.11.4
Filippo Valsorda [Fri, 14 Dec 2018 21:04:50 +0000 (16:04 -0500)]
doc: document Go 1.11.4

Change-Id: Ic098bd69fa9e3f7b2ed6c451a7a266167c0cde94
Reviewed-on: https://go-review.googlesource.com/c/154302
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
6 years agodoc: document Go 1.10.7
Filippo Valsorda [Fri, 14 Dec 2018 21:14:56 +0000 (16:14 -0500)]
doc: document Go 1.10.7

Change-Id: Id71aad4cf6149e0ba15f7fec0b74517827c37866
Reviewed-on: https://go-review.googlesource.com/c/154303
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
6 years agonet/http/httptest: don't register a flag unless it looks like it's in use
Brad Fitzpatrick [Fri, 14 Dec 2018 18:33:13 +0000 (18:33 +0000)]
net/http/httptest: don't register a flag unless it looks like it's in use

We shouldn't pollute people's flags with this debugging flag that was
never really meant to be public. It's certainly not documented.

So keep it for now, but don't register it unless it looks like it's in
use (by looking at os.Args). Kinda gross, but less gross than before.

Fixes #28619

Change-Id: I47498948a26a71ff36f9658a6d9dac73fd0a3016
Reviewed-on: https://go-review.googlesource.com/c/154217
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
6 years agointernal/x/net/http2/hpack: update from upstream
Brad Fitzpatrick [Thu, 13 Dec 2018 20:28:29 +0000 (20:28 +0000)]
internal/x/net/http2/hpack: update from upstream

Updates to x/net git rev 891ebc4b82d6e74f468c533b06f983c7be918a96 for:

   http2/hpack: track the beginning of a header block
   https://go-review.googlesource.com/c/153978

Updates golang/go#29187

Change-Id: Ie2568b3f8d6aaa3f097a4ac25d3acdc794f5ff5c
Reviewed-on: https://go-review.googlesource.com/c/154118
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
6 years agocmd/go/internal/get: move wildcard-trimming to before CheckImportPath
Bryan C. Mills [Fri, 14 Dec 2018 02:42:33 +0000 (21:42 -0500)]
cmd/go/internal/get: move wildcard-trimming to before CheckImportPath

Previously, RepoRootForImportPath trimmed certain "..." wildcards from
package patterns (even though its name suggests that the argument must
be an actual import path). It trimmed at the first path element that
was literally "..." (although wildcards in general may appear within a
larger path element), and relied on a subsequent check in
RepoRootForImportPath to catch confusing resolutions.

However, that causes 'go get' with wildcard patterns in fresh paths to
fail as of CL 154101: a wildcard pattern is not a valid import path,
and fails the path check. (The existing Test{Vendor,Go}Get* packages
in go_test.go and vendor_test.go catch the failure, but they are all
skipped when the "-short" flag is set — including in all.bash — and we
had forgotten to run them separately.)

We now trim the path before any element that contains a wildcard, and
perform the path check (and repo resolution) on only that prefix. It
is possible that the expanded path after fetching the repo will be
invalid, but a repository can contain directories that are not valid
import paths in general anyway.

Fixes #29241

Change-Id: I70fb2f7fc6603b7d339fd6c02e8cdeacfc93fc4b
Reviewed-on: https://go-review.googlesource.com/c/154108
Reviewed-by: Russ Cox <rsc@golang.org>
6 years agosyscall: remove linknames to runtime symbols for aix/ppc64
Clément Chigot [Thu, 13 Dec 2018 12:37:57 +0000 (13:37 +0100)]
syscall: remove linknames to runtime symbols for aix/ppc64

Replaces //go:linkname by assembly functions for syscall
functions on aix/ppc64.
Since the new runtime internal ABI, this was triggering an error if
syscall.Syscall6 was called by others packages like x/sys/unix.
This commit should remove every future occurences of this problem.

Fixes #28769

Change-Id: I6a4bf77472ee1e974bdb76b27e74275e568f5a76
Reviewed-on: https://go-review.googlesource.com/c/153997
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
6 years agocmd/compile: fix length overflow when appending elements to a slice
Martin Möhrmann [Thu, 13 Dec 2018 16:55:52 +0000 (17:55 +0100)]
cmd/compile: fix length overflow when appending elements to a slice

Instead of testing len(slice)+numNewElements > cap(slice) use
uint(len(slice)+numNewElements) > uint(cap(slice)) to test
if a slice needs to be grown in an append operation.

This prevents a possible overflow when len(slice) is near the maximum
int value and the addition of a constant number of new elements
makes it overflow and wrap around to a negative number which is
smaller than the capacity of the slice.

Appending a slice to a slice with append(s1, s2...) already used
a uint comparison to test slice capacity and therefore was not
vulnerable to the same overflow issue.

Fixes: #29190
Change-Id: I41733895838b4f80a44f827bf900ce931d8be5ca
Reviewed-on: https://go-review.googlesource.com/c/154037
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agocmd/go: set user and email in test-local git repos
Bryan C. Mills [Thu, 13 Dec 2018 14:23:25 +0000 (09:23 -0500)]
cmd/go: set user and email in test-local git repos

Some of the builders cannot infer user and email from the builder hostname.

Change-Id: I27e5d011fa1471f27763b6b7fa1bf59e418b925c
Reviewed-on: https://team-review.git.corp.google.com/c/376739
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-on: https://go-review.googlesource.com/c/154107
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agodoc: document Go 1.11.3 and Go 1.10.6
Dmitri Shuralyov [Wed, 12 Dec 2018 18:35:19 +0000 (13:35 -0500)]
doc: document Go 1.11.3 and Go 1.10.6

Change-Id: I3fe44887a84586d73be01df78a9cbb002c1fc9c5
Reviewed-on: https://team-review.git.corp.google.com/c/376465
Reviewed-by: Filippo Valsorda <valsorda@google.com>
Reviewed-on: https://go-review.googlesource.com/c/154106
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocrypto/x509: limit number of signature checks for each verification
Filippo Valsorda [Wed, 5 Dec 2018 03:23:22 +0000 (22:23 -0500)]
crypto/x509: limit number of signature checks for each verification

That number grows quadratically with the number of intermediate
certificates in certain pathological cases (for example if they all have
the same Subject) leading to a CPU DoS. Set a fixed budget that should
fit all real world chains, given we only look at intermediates provided
by the peer.

The algorithm can be improved, but that's left for follow-up CLs:

    * the cache logic should be reviewed for correctness, as it seems to
      override the entire chain with the cached one
    * the equality check should compare Subject and public key, not the
      whole certificate
    * certificates with the right SKID but the wrong Subject should not
      be considered, and in particular should not take priority over
      certificates with the right Subject

Fixes #29233

Change-Id: Ib257c12cd5563df7723f9c81231d82b882854213
Reviewed-on: https://team-review.git.corp.google.com/c/370475
Reviewed-by: Andrew Bonventre <andybons@google.com>
Reviewed-on: https://go-review.googlesource.com/c/154105
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>

6 years agocmd/go/internal/get: relax pathOK check to allow any letter
Bryan C. Mills [Tue, 4 Dec 2018 22:00:19 +0000 (17:00 -0500)]
cmd/go/internal/get: relax pathOK check to allow any letter

This fixes a regression of #18660 with the new path checks.

Updates #29230

Change-Id: I2dd9adab999e7f810e0e746ad8b75ea9622f56e7
Reviewed-on: https://team-review.git.corp.google.com/c/370578
Reviewed-by: Russ Cox <rsc@google.com>
Reviewed-on: https://go-review.googlesource.com/c/154104
Reviewed-by: Bryan C. Mills <bcmills@google.com>
6 years agocmd/go/internal/get: use a strings.Replacer in expand
Bryan C. Mills [Tue, 4 Dec 2018 20:42:32 +0000 (15:42 -0500)]
cmd/go/internal/get: use a strings.Replacer in expand

This should be a no-op, but produces deterministic (and more correct)
behavior if we have accidentally failed to sanitize one of the inputs.

Updates #29231

Change-Id: I1271d0ffd01a691ec8c84906c4e02d9e2be19c72
Reviewed-on: https://team-review.git.corp.google.com/c/370575
Reviewed-by: Russ Cox <rsc@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-on: https://go-review.googlesource.com/c/154103
Reviewed-by: Bryan C. Mills <bcmills@google.com>
6 years agocmd/go/internal/get: reject Windows shortnames as path components
Bryan C. Mills [Tue, 4 Dec 2018 19:37:39 +0000 (14:37 -0500)]
cmd/go/internal/get: reject Windows shortnames as path components

Updates #29230

Change-Id: Ia32d8ec1fc0c4e242f50d8871c0ef3ce315f3c65
Reviewed-on: https://team-review.git.corp.google.com/c/370571
Reviewed-by: Russ Cox <rsc@google.com>
Reviewed-on: https://go-review.googlesource.com/c/154102
Reviewed-by: Bryan C. Mills <bcmills@google.com>
6 years agocmd/go: reject 'get' of paths containing leading dots or unsupported characters
Bryan C. Mills [Fri, 30 Nov 2018 20:06:40 +0000 (15:06 -0500)]
cmd/go: reject 'get' of paths containing leading dots or unsupported characters

On some platforms, directories beginning with dot are treated as
hidden files, and filenames containing unusual characters can be
confusing for users to manipulate (and delete).

Fixes #29230
Fixes #29231

Change-Id: Ic6f97f577d8fafa83ef62438095a5c7ae022881a
Reviewed-on: https://team-review.git.corp.google.com/c/368507
Reviewed-by: Russ Cox <rsc@google.com>
Reviewed-on: https://go-review.googlesource.com/c/154101
Reviewed-by: Bryan C. Mills <bcmills@google.com>
6 years agogo/doc: simplify and robustify link detection logic
Joe Tsai [Fri, 16 Feb 2018 22:52:10 +0000 (14:52 -0800)]
go/doc: simplify and robustify link detection logic

To fix #5043, we added logic to allow balanced pairs of parenthesis
so that we could match URLs like:
http://example.com/some_resource(foo)

Howewer, such logic breaks when parsing something like the following:
art by [https://example.com/person][Person Name]].
such that the following is considered the link:
https://example.com/person][Person

Since the logic added in #5043 was just a heuristic, we adjust
the heuristic that in addition to requiring balanced pairs,
the first parenthesis must be an opening one.

For further robustness, we apply this heuristic to
parenthesis, braces, and brackets.

Fixes #22285

Change-Id: I23b728a644e35ce3995b05a79129cad2c1e3b1ce
Reviewed-on: https://go-review.googlesource.com/c/94876
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
6 years agomime/multipart: quote boundary in Content-Type if necessary
Ian Lance Taylor [Thu, 13 Dec 2018 23:23:35 +0000 (15:23 -0800)]
mime/multipart: quote boundary in Content-Type if necessary

Fixes #26532

Change-Id: Ic086c90503c7b24982f947c828c7ccf016ddbf69
Reviewed-on: https://go-review.googlesource.com/c/154120
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agotext/html: escape MIME type "application/ld+json" as JavaScript
Evan Klitzke [Mon, 25 Jun 2018 20:27:58 +0000 (20:27 +0000)]
text/html: escape MIME type "application/ld+json" as JavaScript

Fixes #26053

Change-Id: Ic2052b1d0d4e0826a217a520c83d7bb0995ea72a
GitHub-Last-Rev: 5a3eea3dd22b0a194591ce2294b88cb340df1e8d
GitHub-Pull-Request: golang/go#26054
Reviewed-on: https://go-review.googlesource.com/c/120835
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
6 years agofmt: include failing method name in panic message
Ian Lance Taylor [Wed, 12 Dec 2018 23:46:20 +0000 (15:46 -0800)]
fmt: include failing method name in panic message

Fixes #25707

Change-Id: Idfa379db8cc0e105ea68455ec0b4a0dbc1b3f485
Reviewed-on: https://go-review.googlesource.com/c/153827
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agomath: don't run huge argument tests on s390x
Robert Griesemer [Thu, 13 Dec 2018 21:55:15 +0000 (13:55 -0800)]
math: don't run huge argument tests on s390x

The s390x implementations for Sin/Cos/SinCos/Tan use assembly
routines which don't reduce arguments accurately enough for
huge inputs.

Fixes #29221.

Change-Id: I340f576899d67bb52a553c3ab22e6464172c936d
Reviewed-on: https://go-review.googlesource.com/c/154119
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/go/internal/work: skip TestRespectSetgidDir on js.
Bryan C. Mills [Thu, 13 Dec 2018 19:30:57 +0000 (14:30 -0500)]
cmd/go/internal/work: skip TestRespectSetgidDir on js.

chown is not implemented on js: see https://build.golang.org/log/43d7b12602660b786a6e080e685165193df0de00.

Change-Id: I3f461338825bb670d682c3f47b17ee1638343fc8
Reviewed-on: https://go-review.googlesource.com/c/154097
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agogo/internal/gccgoimporter: test fix for older gccgo versions
Than McIntosh [Thu, 13 Dec 2018 13:17:09 +0000 (08:17 -0500)]
go/internal/gccgoimporter: test fix for older gccgo versions

Avoid running the test for issue 29198 if the available copy of gccgo
is too old (needs to support context package). Fixes a failure on the
solaris builder.

Updates #29198.

Change-Id: I2b1b3438f4ac105432f30078fbef78e24f2077cd
Reviewed-on: https://go-review.googlesource.com/c/153831
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agomath: correct mPi4 comment
Brian Kessler [Thu, 13 Dec 2018 16:19:11 +0000 (09:19 -0700)]
math: correct mPi4 comment

The previous comment mis-stated the number of bits in mPi4.
The correct value is 19*64 + 1 == 1217 bits.

Change-Id: Ife971ff6936ce2d5b81ce663ce48044749d592a0
Reviewed-on: https://go-review.googlesource.com/c/154017
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/vendor: update vendored golang.org/x/sys/unix
Brad Fitzpatrick [Thu, 13 Dec 2018 19:50:40 +0000 (19:50 +0000)]
cmd/vendor: update vendored golang.org/x/sys/unix

To x/sys git rev 4d1cda033e0619309c606fc686de3adcf599539e

Fixes #29224

Change-Id: I696c815b4c2d26e8340c77cb77d1a37245c40ed2
Reviewed-on: https://go-review.googlesource.com/c/154117
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agodoc/go1.12: add note about CL 153559's syscall/js.Callback rename
Brad Fitzpatrick [Thu, 13 Dec 2018 18:22:53 +0000 (18:22 +0000)]
doc/go1.12: add note about CL 153559's syscall/js.Callback rename

Updates #28711

Change-Id: I03139a394fdf0540db07d6d1e38b3fa223b06d58
Reviewed-on: https://go-review.googlesource.com/c/154059
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agobytes: add ReplaceAll example
dupoxy [Thu, 13 Dec 2018 18:52:17 +0000 (18:52 +0000)]
bytes: add ReplaceAll example

Change-Id: I36cc0b68a5a47ac78982b05118c58723c9c6648c
GitHub-Last-Rev: 0704d9569407d8b84d1ddcf845b759f7daa91ec1
GitHub-Pull-Request: golang/go#29203
Reviewed-on: https://go-review.googlesource.com/c/153842
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agodoc: 1.12 release notes for regexp, runtime, and runtime/debug packages
Katie Hockman [Wed, 5 Dec 2018 19:54:33 +0000 (14:54 -0500)]
doc: 1.12 release notes for regexp, runtime, and runtime/debug packages

Change-Id: I30686cbeda34f42d5b1848b884588a76a9fb28b9
Reviewed-on: https://go-review.googlesource.com/c/152741
Reviewed-by: Andrew Bonventre <andybons@golang.org>
6 years agocmd/go: test 'go get' and 'go install' with an (invalid) module ending in /v1
Bryan C. Mills [Wed, 12 Dec 2018 21:53:09 +0000 (16:53 -0500)]
cmd/go: test 'go get' and 'go install' with an (invalid) module ending in /v1

We expect major version v1 to not have a /v1 suffix.
(Such a suffix on the package path is fine, but not on the module path.)

Fixes #26375

Change-Id: I4206ded82ede36440cedfaf39875c38b9c95dc27
Reviewed-on: https://go-review.googlesource.com/c/153823
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
6 years agosyscall/js: rename js.Callback to js.Func
Richard Musiol [Tue, 11 Dec 2018 13:23:17 +0000 (14:23 +0100)]
syscall/js: rename js.Callback to js.Func

The name "Callback" does not fit to all use cases of js.Callback.
This commit changes its name to Func. Accordingly NewCallback
gets renamed to FuncOf, which matches ValueOf and TypedArrayOf.

The package syscall/js is currently exempt from Go's compatibility
promise and js.Callback is already affected by a breaking change in
this release cycle. See #28711 for details.

Fixes #28711

Change-Id: I2c380970c3822bed6a3893909672c15d0cbe9da3
Reviewed-on: https://go-review.googlesource.com/c/153559
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoruntime: correct signal structs/offsets for openbsd/arm
Joel Sing [Thu, 13 Dec 2018 18:03:37 +0000 (05:03 +1100)]
runtime: correct signal structs/offsets for openbsd/arm

Update sigcontext and siginfo structs to match those currently in use by OpenBSD armv7.

Also correct the offset of the fault address field in the siginfo struct, which moved
due to the switch to EABI.

Change-Id: Icdd95222346239fcc04b95ae0fcefae09b7aa044
Reviewed-on: https://go-review.googlesource.com/c/154077
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agodoc/go1.12: add release notes for bufio and syscall packages
Andrew Bonventre [Wed, 12 Dec 2018 22:03:34 +0000 (17:03 -0500)]
doc/go1.12: add release notes for bufio and syscall packages

Change-Id: I5112be3b0f80ef1d9dad234b1f233e598465a409
Reviewed-on: https://go-review.googlesource.com/c/153824
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoruntime,os,syscall,internal/poll: replace getdirentries on iOS
Elias Naur [Sat, 8 Dec 2018 15:45:29 +0000 (16:45 +0100)]
runtime,os,syscall,internal/poll: replace getdirentries on iOS

The getdirentries syscall is considered private API on iOS and is
rejected by the App Store submission checks. Replace it with the
fdopendir/readdir_r/closedir syscalls.

Fixes #28984

Change-Id: I73341b124310e9cb34834a95f946769f337ec5b7
Reviewed-on: https://go-review.googlesource.com/c/153338
Reviewed-by: Keith Randall <khr@golang.org>
6 years agocmd/go/internal/work: ensure correct group for TestRespectSetgidDir
Mark Pulford [Sat, 8 Dec 2018 16:30:08 +0000 (03:30 +1100)]
cmd/go/internal/work: ensure correct group for TestRespectSetgidDir

mkdir(2) inherits the parent directory group on *BSD (including Darwin),
and it may inherit on other platforms if the parent directory is SetGID.

This can cause TestRespectSetgidDir SetGID to fail when the process does
not have have permission for the inherited group on the new temporary
directory.

Fixes #29160

Change-Id: Iac05511e501dfe307a753f801223b1049cc0947d
Reviewed-on: https://go-review.googlesource.com/c/153357
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agoos/signal: increase wait time for signal delivery time in testcase
Lynn Boger [Wed, 12 Dec 2018 21:18:19 +0000 (16:18 -0500)]
os/signal: increase wait time for signal delivery time in testcase

This increases the time to wait from 1 to 2 seconds in the
TestAtomicStop testcase. When running with gccgo on ppc64
& ppc64le on a loaded systems these testcases can
intermittently fail with the current value.

Updates #29046

Change-Id: If420274dd65926d933a3024903b5c757c300bd60
Reviewed-on: https://go-review.googlesource.com/c/153826
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agomath: use constant rather than variable for exported test threshold
Robert Griesemer [Thu, 13 Dec 2018 06:08:50 +0000 (22:08 -0800)]
math: use constant rather than variable for exported test threshold

This is a minor follow-up on https://golang.org/cl/153059.

TBR=iant

Updates #6794.

Change-Id: I03657dafc572959d46a03f86bbeb280825bc969d
Reviewed-on: https://go-review.googlesource.com/c/153845
Reviewed-by: Robert Griesemer <gri@golang.org>
6 years agomath: implement trignometric range reduction for huge arguments
Brian Kessler [Thu, 6 Sep 2018 18:06:45 +0000 (12:06 -0600)]
math: implement trignometric range reduction for huge arguments

This change implements Payne-Hanek range reduction by Pi/4
to properly calculate trigonometric functions of huge arguments.

The implementation is based on:

"ARGUMENT REDUCTION FOR HUGE ARGUMENTS: Good to the Last Bit"
K. C. Ng et al, March 24, 1992

The major difference with the reference is that the simulated
multi-precision calculation of x*B is implemented using 64-bit
integer arithmetic rather than floating point to ease extraction
of the relevant bits of 4/Pi.

The assembly implementations for 386 were removed since the trigonometric
instructions only use a 66-bit representation of Pi internally for
reduction.  It is not possible to use these instructions and maintain
accuracy without a prior accurate reduction in software as recommended
by Intel.

Fixes #6794

Change-Id: I31bf1369e0578891d738c5473447fe9b10560196
Reviewed-on: https://go-review.googlesource.com/c/153059
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agocmd/link: skip TestRuntimeTypeAttrInternal on windows/arm
Jordan Rhee [Thu, 13 Dec 2018 01:38:17 +0000 (17:38 -0800)]
cmd/link: skip TestRuntimeTypeAttrInternal on windows/arm

Updates #26148

Change-Id: Ide1fe821cc061a08488df9d40878131f37f894c9
Reviewed-on: https://go-review.googlesource.com/c/153844
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/vendor: update golang.org/x/sys/unix
Joel Sing [Wed, 12 Dec 2018 13:32:47 +0000 (00:32 +1100)]
cmd/vendor: update golang.org/x/sys/unix

Update golang.org/x/sys/unix to revision b05ddf57801d2239d6ab0ee35f9d981e0420f4ac.

Changes exist in upstream golang.org/x/sys/unix, which allow for code to work and
tests to pass on openbsd/arm.

Change-Id: Iecc8598681a23cb0466f94c914f0e605a6fc64d7
Reviewed-on: https://go-review.googlesource.com/c/153838
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agosyscall: use correct cmsg alignment for openbsd/arm
Joel Sing [Wed, 12 Dec 2018 13:38:37 +0000 (00:38 +1100)]
syscall: use correct cmsg alignment for openbsd/arm

The OpenBSD armv7 port requires 64-bit alignment for cmsgs.

Rework the cmsg alignment code to facilitate this.

Change-Id: I52cf55a8a4cda46c6ef35b0f694862b842028b42
Reviewed-on: https://go-review.googlesource.com/c/153837
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agostrings: add ReplaceAll example
dupoxy [Wed, 12 Dec 2018 22:49:31 +0000 (22:49 +0000)]
strings: add ReplaceAll example

Change-Id: I6b0d470bdedb92844943c8e5823e214d6a7471cf
GitHub-Last-Rev: 4a135000ba9c23a588b960e5b2989710cc71e3e2
GitHub-Pull-Request: golang/go#29199
Reviewed-on: https://go-review.googlesource.com/c/153840
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agostrings: revert accidental example change from CL 153840
Brad Fitzpatrick [Wed, 12 Dec 2018 22:28:50 +0000 (22:28 +0000)]
strings: revert accidental example change from CL 153840

Change-Id: I2ff29aa9909be3062fcd5f65af261f5d8c46fbc1
Reviewed-on: https://go-review.googlesource.com/c/153843
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agogo/build: document when Context.BuildTags is used.
Muhammad Falak R Wani [Wed, 29 Aug 2018 00:01:46 +0000 (05:31 +0530)]
go/build: document when Context.BuildTags is used.

Context.BuildTags is not set when you read go/build.Default.BuildTags.
It's only used by (*BuildTags).Import, etc.

Fixes: #27320
Change-Id: I97e5f1923c410b48f70be8c15938a7e04a178e3f
Reviewed-on: https://go-review.googlesource.com/c/131975
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoruntime: pass LR to sigprof on windows/arm
Jordan Rhee [Wed, 12 Dec 2018 19:28:46 +0000 (11:28 -0800)]
runtime: pass LR to sigprof on windows/arm

TestCPUProfileLabel was failing on windows/arm because the link register
was not being passed to sigprof(). The link register is required to
generate a correct traceback. With this change, all tests in runtime.pprof
are now passing.

Updates #26148

Change-Id: Ia693b34278dc08a98023751ff1a922d9eee8fdd6
Reviewed-on: https://go-review.googlesource.com/c/153839
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/go: reject GOCACHE=off when the default cache is initialized
Bryan C. Mills [Fri, 7 Dec 2018 17:05:00 +0000 (12:05 -0500)]
cmd/go: reject GOCACHE=off when the default cache is initialized

Allow GOCACHE=off only for operations that never actually write
anything to the cache (in which case the GOCACHE setting should not
matter at all).

Fixes #29127

Change-Id: I733d02cd2fbcf3671f5adcfb73522865d131e360
Reviewed-on: https://go-review.googlesource.com/c/153462
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
6 years agogo/internal/gccgoimporter: permit fixups for V2 export data
Than McIntosh [Wed, 12 Dec 2018 19:38:03 +0000 (14:38 -0500)]
go/internal/gccgoimporter: permit fixups for V2 export data

The changes added in https://golang.org/cl/151997 to fix problems when
reading older export data introduced the ability to add "fixups" to
handle references to a type whose definition has not yet been
finalized. It turns out we need to allow for fixups even for more
recent export data (V2 and V3); this patch removes a version guard for
the fixup generation logic.

Fixes #29198.

Change-Id: I82136ac45b53e4a59c05ff0879ac6bb545d0ff31
Reviewed-on: https://go-review.googlesource.com/c/153821
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/go/internal/web2: log http requests with -v
Hana Kim [Tue, 11 Dec 2018 23:06:50 +0000 (18:06 -0500)]
cmd/go/internal/web2: log http requests with -v

It's similar to what cmd/go/internal/web package does
when cfg.BuildV is set. The web2 package is what
cmd/go/internal/modfetch uses, so this change allows us
to trace web requests go get command in module mode
sends for modfetch.

Change-Id: If387efd8a8698c816bf267d1e6c6766fd357c298
Reviewed-on: https://go-review.googlesource.com/c/153640
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agosyscall: update doc comment to match behavior for Proc.Call
Andrew Bonventre [Wed, 12 Dec 2018 22:05:06 +0000 (17:05 -0500)]
syscall: update doc comment to match behavior for Proc.Call

golang.org/cl/147117 increased the number of arguments permitted
by Proc.Call on Windows, but the doc comment was never updated.

Change-Id: Iea5eb9e0aafbc1025d5fcb8665d028b2254c183a
Reviewed-on: https://go-review.googlesource.com/c/153825
Reviewed-by: Channing Kimble-Brown <ckimblebrown@google.com>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
6 years agocmd/go/internal/modfetch: skip symlinks in (*coderepo).Zip
Bryan C. Mills [Wed, 12 Dec 2018 03:46:55 +0000 (22:46 -0500)]
cmd/go/internal/modfetch: skip symlinks in (*coderepo).Zip

Tested manually.

Before:

$ go mod init golang.org/issue/scratch
go: creating new go.mod: module golang.org/issue/scratch
$ go1.11.2 mod download github.com/rogpeppe/test2@latest
go: finding github.com/rogpeppe/test2 v0.0.11
$ find $GOPATH -name goodbye
/tmp/tmp.Y8a8UzX3zD/_gopath/pkg/mod/github.com/rogpeppe/test2@v0.0.11/tests/goodbye
$ cat $(find $GOPATH -name goodbye)
hello

After:

$ go mod init golang.org/issue/scratch
go: creating new go.mod: module golang.org/issue/scratch
$ go mod download github.com/rogpeppe/test2@latest
go: finding github.com/rogpeppe/test2 v0.0.11
$ find $GOPATH -name goodbye
$ find $GOPATH -name hello
/tmp/tmp.Zo0jhfLaRs/_gopath/pkg/mod/github.com/rogpeppe/test2@v0.0.11/tests/hello

A proper regression test would require one of:
• a new entry in the vcs-test server (feasible but tedious, and not easily updated by open-source contributors), or
• a way to set up an HTTPS proxy in a script_test, or
• a way to explicitly populate the module cache from the contents of a local repository (#28835).

Fixes #27093
Updates #28835

Change-Id: I72702a7e791f8815965f0f87c82a30df4d6f0151
Reviewed-on: https://go-review.googlesource.com/c/153819
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
6 years agocmd/go: reproduce #28680
Bryan C. Mills [Wed, 12 Dec 2018 03:14:37 +0000 (22:14 -0500)]
cmd/go: reproduce #28680

This change encodes the current behavior in mod_clean_cache.txt.
A fix for that behavior will probably have to wait for 1.13.

Updates #28680

Change-Id: I216b5a783971309cc75187502bddccc58c3a9c35
Reviewed-on: https://go-review.googlesource.com/c/153818
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
6 years agocmd/go: retain sums for replacement modules in 'go mod tidy'
Bryan C. Mills [Wed, 12 Dec 2018 02:03:11 +0000 (21:03 -0500)]
cmd/go: retain sums for replacement modules in 'go mod tidy'

Fixes #27868

Change-Id: I6c2d221c4325a2f44625e797a82735d812ee0ec1
Reviewed-on: https://go-review.googlesource.com/c/153817
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
6 years agocmd/compile: don't combine load+op if the op has SymAddr arguments
Keith Randall [Wed, 12 Dec 2018 00:12:57 +0000 (16:12 -0800)]
cmd/compile: don't combine load+op if the op has SymAddr arguments

By combining the load+op, we may force the op to happen earlier in
the store chain. That might force the SymAddr operation earlier, and
in particular earlier than its corresponding VarDef. That leads to
an invalid schedule, so avoid that.

This is kind of a hack to work around the issue presented. I think
the underlying problem, that LEAQ is not directly ordered with respect
to its vardef, is the real problem. The benefit of this CL is that
it fixes the immediate issue, is small, and obviously won't break
anything. A real fix for this issue is much more invasive.

The go binary is unchanged in size.
This situation just doesn't occur very often.

Fixes #28445

Change-Id: I13a765e13f075d5b6808a355ef3c43cdd7cd47b6
Reviewed-on: https://go-review.googlesource.com/c/153641
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
6 years agodoc/go1.12: release notes for testing
Julie Qiu [Thu, 6 Dec 2018 16:02:49 +0000 (11:02 -0500)]
doc/go1.12: release notes for testing

Change-Id: I81ffe7ee88354efeabb24f091db66c7c4892876c
Reviewed-on: https://go-review.googlesource.com/c/152919
Reviewed-by: Andrew Bonventre <andybons@golang.org>
6 years agocmd/go: link to the FAQ for errors that indicate private VCS repos.
Julie Qiu [Tue, 20 Nov 2018 22:42:59 +0000 (17:42 -0500)]
cmd/go: link to the FAQ for errors that indicate private VCS repos.

Updates #25982

Change-Id: I5a284e3844e944f9bfae31fa65b242060d4139c7
Reviewed-on: https://go-review.googlesource.com/c/150777
Run-TryBot: Julie Qiu <julie@golang.org>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
6 years agoencoding/xml, encoding/json: docs and examples using custom marshalers
Leigh McCulloch [Tue, 11 Dec 2018 05:32:50 +0000 (05:32 +0000)]
encoding/xml, encoding/json: docs and examples using custom marshalers

Both the encoding/xml and encoding/json packages support custom
marshalers for JSON and XML, as well as the basic encoding.TextMarshaler
and encoding.TextUnmarshaler interfaces, but the docs and examples for
these are missing.

There are docs for how to use encoding.TextMarshaler and
encoding.TextUnmarshaler in encoding/json, but not encoding/xml. There
are no examples for how to use them with either json or xml. This commit
includes docs for encoding/xml and examples for both encoding/json and
encoding/xml.

There is an example using custom marshalers MarshalJSON and
UnmarshalJSON in encoding/json, but not MarshalXML and UnmarshalXML in
encoding/json. These docs are more so necessary for encoding/xml because
the complexities of XML documents is significantly greater than JSON
documents which more often leads to the need for custom marshaling. The
encoding/json package includes an example of how to write a custom
marshaler, and this commit includes the same example for the xml
package.

All examples are mirrored off the existing custom marshaler example in
encoding/json.

Fixes #6859

Change-Id: Ic93abc27c0b4d5e48dea6ede4e20b1bedca4ab39
Reviewed-on: https://go-review.googlesource.com/c/76350
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/compile: Avoid and filter out zero-length location-lists.
David Chase [Thu, 15 Nov 2018 19:11:19 +0000 (14:11 -0500)]
cmd/compile: Avoid and filter out zero-length location-lists.

This change avoids creating zero length location lists by
repairing an overly aggressive change in CL146718
and by explicitly checking for and filtering out any
zero-length lists that are detected (building
compiler+runtime creates a single one).

Updates #28486.

Change-Id: I01c571fee2376474c7f3038e801bd58fd9e0b820
Reviewed-on: https://go-review.googlesource.com/c/150097
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
6 years agogo/format: add simple benchmark framework and basic benchmark
Robert Griesemer [Wed, 12 Dec 2018 01:23:14 +0000 (17:23 -0800)]
go/format: add simple benchmark framework and basic benchmark

For now, this CL adds as a first benchmark the formatting of
a 10,000 element array literal. It is easy to add additional
test cases as we see fit.

name                   time/op
Format/array1-10000-4    26.7ms ± 7%

name                   speed
Format/array1-10000-4  2.43MB/s ± 6%

name                   alloc/op
Format/array1-10000-4    5.52MB ± 0%

name                   allocs/op
Format/array1-10000-4      119k ± 0%

Updates #26528.

Change-Id: Ic8ec8f70160d122b877740412d4d4406f5f4b345
Reviewed-on: https://go-review.googlesource.com/c/153642
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoruntime/pprof: ignore cpu profile test failures on openbsd/arm
Joel Sing [Tue, 11 Dec 2018 16:43:48 +0000 (03:43 +1100)]
runtime/pprof: ignore cpu profile test failures on openbsd/arm

This test is currently too flakey on openbsd/arm - ignore failures for the time
being.

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

6 years agosyscall: regenerate ztypes for openbsd/arm
Joel Sing [Tue, 11 Dec 2018 16:36:39 +0000 (03:36 +1100)]
syscall: regenerate ztypes for openbsd/arm

Regenerate ztypes for openbsd/arm - most of the changes relate to the OpenBSD armv7 port
switching to EABI in September 2016.

Also use signed char when generating openbsd/arm ztypes, to avoid inconsistencies between
architectures impacting MI code.

Change-Id: I9d2e19c1ac045922e270896861c830f94fc59c10
Reviewed-on: https://go-review.googlesource.com/c/153578
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoos: in RemoveAll, try Remove first
Ian Lance Taylor [Wed, 12 Dec 2018 00:55:16 +0000 (16:55 -0800)]
os: in RemoveAll, try Remove first

Otherwise we can fail to remove a unreadable empty directory.

Fixes #29178

Change-Id: I43d5c89fce57a86626abe2a1c2bbf145716e087b
Reviewed-on: https://go-review.googlesource.com/c/153720
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoruntime/pprof: fix TestCPUProfileWithFork on Windows/ARM
Jordan Rhee [Tue, 11 Dec 2018 22:57:59 +0000 (14:57 -0800)]
runtime/pprof: fix TestCPUProfileWithFork on Windows/ARM

Use smaller heap on Windows/ARM, which generally does not have
page file enabled and therefore has limited virtual address space.

Updates #26148

Signed-off-by: Jordan Rhee <jordanrh@microsoft.com>
Change-Id: I4030be24a10fab7b9b659e3736b7e83f10710bfa
Reviewed-on: https://go-review.googlesource.com/c/153719
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoruntime: fix profiling on windows/ARM
Jordan Rhee [Tue, 11 Dec 2018 22:24:07 +0000 (14:24 -0800)]
runtime: fix profiling on windows/ARM

Fix profiling handler to get the correct g for the m being profiled.
Store a pointer to the TLS slot holding g in the thread's m. This
enables the profiling handler to get the current g for the thread,
even if the thread is executing external code or system code.

Updates #26148

Signed-off-by: Jordan Rhee <jordanrh@microsoft.com>
Change-Id: Ie061284c12341c76c7d96cc0c2d5bac969230829
Reviewed-on: https://go-review.googlesource.com/c/153718
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/cgo: set correct column for user-written code
Ian Lance Taylor [Wed, 28 Nov 2018 22:19:28 +0000 (14:19 -0800)]
cmd/cgo: set correct column for user-written code

Take advantage of the new /*line*/ comments.

Fixes #26745

Change-Id: I8098642e0f11f7418fe81b9a08dbe07671f930fe
Reviewed-on: https://go-review.googlesource.com/c/151598
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
6 years agocmd/go: fix 'go test' and 'go fmt' with files outside a module
Bryan C. Mills [Mon, 10 Dec 2018 20:02:38 +0000 (15:02 -0500)]
cmd/go: fix 'go test' and 'go fmt' with files outside a module

Use the actual loader result in findModule instead of making
assumptions about nesting in the build list.
As a side-effect, this produces much clearer error messages for
packages that (for one reason or another) failed to load.

Adjust the package and module path outside a module to
"command-line-arguments". That string already appears in the output of
a number of (module-mode and GOPATH-mode) commands for file arguments,
and as far as I can tell operation outside a module is currently the
only case in which the module path of a package is not actually a
prefix of the import path.

Fixes #28011
Fixes #27099
Fixes #28943
Updates #27102
Updates #28459
Updates #27063

Change-Id: I61d5556df7b1b7d1efdaffa892f0e3e95b612d87
Reviewed-on: https://go-review.googlesource.com/c/153459
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
6 years agocmd/go/internal/modfetch/codehost: return VCSError for unimplemented functions and...
Bryan C. Mills [Mon, 10 Dec 2018 19:58:08 +0000 (14:58 -0500)]
cmd/go/internal/modfetch/codehost: return VCSError for unimplemented functions and malformed responses

Updates #28943
Updates #26092

Change-Id: I07af2731ef5af046b9f7c7280ccb3976cdf41ca4
Reviewed-on: https://go-review.googlesource.com/c/153458
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
6 years agocmd/compile: use innermost line number for -S
Keith Randall [Fri, 7 Dec 2018 18:00:36 +0000 (10:00 -0800)]
cmd/compile: use innermost line number for -S

When functions are inlined, for instructions in the inlined body, does
-S print the location of the call, or the location of the body? Right
now, we do the former. I'd like to do the latter by default, it makes
much more sense when reading disassembly. With mid-stack inlining
enabled in more cases, this quandry will come up more often.

The original behavior is still available with -S=2. Some tests
use this mode (so they can find assembly generated by a particular
source line).

This helped me with understanding what the compiler was doing
while fixing #29007.

Change-Id: Id14a3a41e1b18901e7c5e460aa4caf6d940ed064
Reviewed-on: https://go-review.googlesource.com/c/153241
Reviewed-by: David Chase <drchase@google.com>
6 years agocmd/go: add a [root] condition to script_test
Bryan C. Mills [Tue, 11 Dec 2018 16:48:01 +0000 (11:48 -0500)]
cmd/go: add a [root] condition to script_test

[root] reports whether the current effective user ID is 0.

Updates #29127

Change-Id: I9ef42f1271ea669689011e7ceff4d918c0cecb6b
Reviewed-on: https://go-review.googlesource.com/c/153637
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agogo/internal/gccgoimporter: add XCOFF support
Clément Chigot [Wed, 5 Dec 2018 16:27:24 +0000 (17:27 +0100)]
go/internal/gccgoimporter: add XCOFF support

This commit adds support to read XCOFF files and AIX big archives in
go/internal/gccgoimporter.

Fixes: #29113
Change-Id: Id84d40358ff98fae5a576d1ebdd65980896365b9
Reviewed-on: https://go-review.googlesource.com/c/152720
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
6 years agocmd/go: add a chmod command to script_test
Bryan C. Mills [Fri, 7 Dec 2018 22:36:55 +0000 (17:36 -0500)]
cmd/go: add a chmod command to script_test

Change-Id: I5d4f65553f6c368d101be59aae9440f5ec9573b7
Reviewed-on: https://go-review.googlesource.com/c/153461
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agointernal/xcoff: add big archive support
Clément Chigot [Mon, 10 Dec 2018 09:53:39 +0000 (10:53 +0100)]
internal/xcoff: add big archive support

This commit adds support to read AIX big archive inside internal/xcoff
package.

Change-Id: I4317b40824b24312a69c918dfc6438dc3aff7be7
Reviewed-on: https://go-review.googlesource.com/c/153398
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoruntime: revise openbsd/arm runtime defs
Joel Sing [Tue, 11 Dec 2018 15:19:50 +0000 (02:19 +1100)]
runtime: revise openbsd/arm runtime defs

The OpenBSD arm port switched to EABI in September 2016 - this revises the layout
of the runtime definitions to match what the kernel currently uses.

Change-Id: I1bca7de56979f576862a7c280631e835f7ae4278
Reviewed-on: https://go-review.googlesource.com/c/153577
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/cgo: don't cache bad pointer typedefs
Ian Lance Taylor [Tue, 11 Dec 2018 15:46:10 +0000 (07:46 -0800)]
cmd/cgo: don't cache bad pointer typedefs

The set of bad pointer typedefs changes as we see more typedefs, so
avoid looking in the cache when we find one.

Fixes #29175

Change-Id: Idd82289bdd8628d11a983fa5ec96517e3a5bcbf1
Reviewed-on: https://go-review.googlesource.com/c/153597
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agocmd/cover: simplify and correct isValidIdentifier
Ian Lance Taylor [Tue, 11 Dec 2018 03:35:01 +0000 (19:35 -0800)]
cmd/cover: simplify and correct isValidIdentifier

Per comment on CL 120316.

Updates #25280

Change-Id: I7d078de4030bd10934468e04ff696a34749bd454
Reviewed-on: https://go-review.googlesource.com/c/153500
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
6 years agocmd/nm: run tests in parallel, don't use Scanner on []byte
Ian Lance Taylor [Mon, 10 Dec 2018 23:47:10 +0000 (15:47 -0800)]
cmd/nm: run tests in parallel, don't use Scanner on []byte

Saves about 35% on total test time on my laptop.

Fixes #26471

Change-Id: I15b28b1bc00f889934d577dc7996864bbab10105
Reviewed-on: https://go-review.googlesource.com/c/153499
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/link: only create .init_array section if not empty
Ian Lance Taylor [Fri, 7 Dec 2018 22:19:01 +0000 (14:19 -0800)]
cmd/link: only create .init_array section if not empty

This avoids a warning from old versions of the GNU linker or glibc.

No test because these old versions are not readily available.
I tested this by hand on CentOS 6.

Fixes #28722

Change-Id: I16640c9b83a79f759ec68fac64874803e74fbbfb
Reviewed-on: https://go-review.googlesource.com/c/153257
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/cgo: preserve type information across loadDWARF loop
Ian Lance Taylor [Wed, 5 Dec 2018 22:04:27 +0000 (14:04 -0800)]
cmd/cgo: preserve type information across loadDWARF loop

CL 122575 and its successors introduced a loop calling loadDWARF,
whereas before we only called it once. Pass a single typeConv to each
call, rather than creating a new one in loadDWARF itself. Change the
maps from dwarf.Type to use string keys rather than dwarf.Type keys,
since when the DWARF is reloaded the dwarf.Type pointers will be
different. These changes permit typeConv.Type to return a consistent
value for a given DWARF type, avoiding spurious type conversion errors
due to typedefs loaded after the first loop iteration.

Fixes #27340

Change-Id: Ic33467bbfca4c54e95909621b35ba2a58216d96e
Reviewed-on: https://go-review.googlesource.com/c/152762
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
6 years agocmd/compile: emit a symbol for a method expression when using -dynlink
Ian Lance Taylor [Sat, 8 Dec 2018 02:22:04 +0000 (18:22 -0800)]
cmd/compile: emit a symbol for a method expression when using -dynlink

Fixes #25065

Change-Id: Ia3db518cfd9c006caf951b51342a491ac8372e9c
Reviewed-on: https://go-review.googlesource.com/c/153297
Reviewed-by: Robert Griesemer <gri@golang.org>
6 years agodoc: use https scheme in oss-distros link
Dmitri Shuralyov [Mon, 10 Dec 2018 20:32:17 +0000 (15:32 -0500)]
doc: use https scheme in oss-distros link

The https scheme is supported, and should be used per best practices.

The previous http link redirected to https:

$ curl -i 'http://oss-security.openwall.org/wiki/mailing-lists/distros'
HTTP/1.1 302 Moved Temporarily
Location: https://oss-security.openwall.org/wiki/mailing-lists/distros

Change-Id: I857b93eeec45996d6dc05dbf7532d1759bf4d447
Reviewed-on: https://go-review.googlesource.com/c/153457
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/compile: set correct line number for method wrappers
Keith Randall [Mon, 10 Dec 2018 22:19:33 +0000 (14:19 -0800)]
cmd/compile: set correct line number for method wrappers

When converting a method to a function, like this:

type T ...
func (t T) foo() {
}
var t T
f := t.foo

We need to build a wrapper function for the partially evaluated
method. Currently that wrapper function gets the line number of
the first place where t.foo appears. Instead it should have the
line number of where foo is declared.

Fixes #26839

Change-Id: I7dbe2094e53d5d336f329273f10f8430e0af544e
Reviewed-on: https://go-review.googlesource.com/c/153498
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
6 years agoruntime: fix CGO traceback frame count
Mark Pulford [Fri, 30 Nov 2018 10:12:06 +0000 (21:12 +1100)]
runtime: fix CGO traceback frame count

Without this, each additional C frame found via SetCgoTraceback will
cause a frame to be dropped from the bottom of the traceback stack.

Fixes #29034

Change-Id: I90aa6b2a1dced90c69b64c5dd565fe64a25724a3
Reviewed-on: https://go-review.googlesource.com/c/151917
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/cover: check that the argument of -var is valid
Andrea Nodari [Thu, 21 Jun 2018 17:01:01 +0000 (18:01 +0100)]
cmd/cover: check that the argument of -var is valid

At the moment, the cover tool does not check that the argument of -var
is a valid identifier. Hence, it could generate a file that fails to
compile afterwards.

Updates #25280

Change-Id: I6eb1872736377680900a18a4a28ba002ab5ea8ca
Reviewed-on: https://go-review.googlesource.com/c/120316
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agohash/fnv: use bits.Mul64 for 128-bit hash
Brian Kessler [Thu, 6 Sep 2018 18:26:31 +0000 (12:26 -0600)]
hash/fnv: use bits.Mul64 for 128-bit hash

Replace the 128-bit multiplication in 4 parts with bits.Mul64
and two single-width multiplications.  This simplifies the code
and increases throughput by ~50% on amd64.

name         old time/op   new time/op   delta
Fnv128KB-4    9.64µs ± 0%   6.09µs ± 0%  -36.89%  (p=0.016 n=4+5)
Fnv128aKB-4   9.11µs ± 0%   6.17µs ± 5%  -32.32%  (p=0.008 n=5+5)

name         old speed     new speed     delta
Fnv128KB-4   106MB/s ± 0%  168MB/s ± 0%  +58.44%  (p=0.016 n=4+5)
Fnv128aKB-4  112MB/s ± 0%  166MB/s ± 5%  +47.85%  (p=0.008 n=5+5)

Change-Id: Id752f2a20ea3de23a41e08db89eecf2bb60b7e6d
Reviewed-on: https://go-review.googlesource.com/c/133936
Run-TryBot: Matt Layher <mdlayher@gmail.com>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Robert Griesemer <gri@golang.org>