]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
4 years agolib/time: update tz data to 2019b
Kyle Shannon [Tue, 2 Jul 2019 00:45:06 +0000 (18:45 -0600)]
lib/time: update tz data to 2019b

Updates #22487

Change-Id: I3c933c68b5c3c5e78e3a9656ea2dcdbcbb59533f
Reviewed-on: https://go-review.googlesource.com/c/go/+/184577
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agocmd/go: update tests for new @upgrade query
Jay Conrod [Wed, 3 Jul 2019 19:14:51 +0000 (15:14 -0400)]
cmd/go: update tests for new @upgrade query

This should have been part of CL 184440.

Updates #32846

Change-Id: I78a1326f4a67b3b526859bd15cb9653b4a8551a7
Reviewed-on: https://go-review.googlesource.com/c/go/+/184920
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

4 years agocmd/go: restore @latest behavior and support @upgrade in 'go get'
Jay Conrod [Mon, 1 Jul 2019 19:25:04 +0000 (15:25 -0400)]
cmd/go: restore @latest behavior and support @upgrade in 'go get'

'go get path@latest' may now downgrade a module required at a
pre-release or pseudo-version newer than the latest released
version. This restores the 1.12 behavior and the ability to easily
roll back from a temporary development version.

'go get path@upgrade' is like @latest but will not downgrade.
If no version suffix is specified ('go get path'), @upgrade is
implied.

Fixes #32846

Change-Id: Ibec0628292ab1c484716a5add0950d7a7ee45f47
Reviewed-on: https://go-review.googlesource.com/c/go/+/184440
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agogo/build: document characters allowed in build tags
Jay Conrod [Wed, 3 Jul 2019 14:22:28 +0000 (10:22 -0400)]
go/build: document characters allowed in build tags

The documentation just said "alphanumeric", but underscores and dots
are also accepted.

Fixes #32886

Change-Id: I1ba872a220d5c5bf64f1d851ddba9eb3b1afb89a
Reviewed-on: https://go-review.googlesource.com/c/go/+/184917
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agotest: add a test for gccgo bug #32901
Cherry Zhang [Tue, 2 Jul 2019 19:36:59 +0000 (15:36 -0400)]
test: add a test for gccgo bug #32901

This CL adds a test for gccgo bug #32901: not all the type
descriptors are registered and thus deduplicated with types
created by reflection. It needs a few levels of indirect imports
to trigger this bug.

Updates #32901.

Change-Id: Idbd89bedd63fea746769f2687f3f31c9767e5ec0
Reviewed-on: https://go-review.googlesource.com/c/go/+/184718
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agodoc/go1.13: fix typo
Tobias Klauser [Tue, 2 Jul 2019 15:07:54 +0000 (17:07 +0200)]
doc/go1.13: fix typo

Change-Id: I99e76c0c12050289be5b353595eb21fbabe7c01e
Reviewed-on: https://go-review.googlesource.com/c/go/+/184597
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agocmd/go: fix TestScript/mod_sumdb_golang to avoid assumptions about @v/list
Bryan C. Mills [Tue, 2 Jul 2019 19:41:04 +0000 (15:41 -0400)]
cmd/go: fix TestScript/mod_sumdb_golang to avoid assumptions about @v/list

I accidentally fetched an invalid version of rsc.io/quote from
proxy.golang.org, which the proxy then cached and now includes in
https://proxy.golang.org/rsc.io/quote/@v/list.

That causes 'go get rsc.io/quote` to resolve to a different version
depending on whether the proxy is used.

Adjust the test to fetch an explicit version instead, since the choice
of 'latest' is mostly irrelevant to the checksum database logic that
the test is intended to verify.

Updates #32805
Fixes #32900

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

4 years agotest: add testcase for gccgo compile failure
Than McIntosh [Wed, 26 Jun 2019 00:24:15 +0000 (20:24 -0400)]
test: add testcase for gccgo compile failure

Test case that caused a compiler crash in gofrontend, related to
exporting inlinable function bodies.

Updates #32778

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

4 years agocmd/compile: make duplicate anonymous interface output deterministic
Keith Randall [Wed, 26 Jun 2019 02:24:34 +0000 (22:24 -0400)]
cmd/compile: make duplicate anonymous interface output deterministic

Taking over CL 162240, the original CL hasn't been making progress.
I just took the parts that fix the immediate issue. I left the
signatslice changes out, I don't think they are necessary.

Fixes #30202

Change-Id: I5b347605f0841dd925d5a73150b8bf269fa82464
Reviewed-on: https://go-review.googlesource.com/c/go/+/183852
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

4 years agoruntime: use correct register in darwin/386 pipe_trampoline
Ian Lance Taylor [Sun, 30 Jun 2019 23:19:58 +0000 (16:19 -0700)]
runtime: use correct register in darwin/386 pipe_trampoline

Updates #31264

Change-Id: I745744dd3fdaa432d70e8dc9336547017bac89ee
Reviewed-on: https://go-review.googlesource.com/c/go/+/184377
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Elias Naur <mail@eliasnaur.com>
4 years agosync: document implementation of Once.Do
Russ Cox [Sat, 29 Jun 2019 13:26:19 +0000 (09:26 -0400)]
sync: document implementation of Once.Do

It's not correct to use atomic.CompareAndSwap to implement Once.Do,
and we don't, but why we don't is a question that has come up
twice on golang-dev in the past few months.
Add a comment to help others with the same question.

Change-Id: Ia89ec9715cc5442c6e7f13e57a49c6cfe664d32c
Reviewed-on: https://go-review.googlesource.com/c/go/+/184261
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ingo Oeser <nightlyone@googlemail.com>
4 years agoruntime: use a pipe to wake up signal_recv on Darwin
Ian Lance Taylor [Fri, 28 Jun 2019 18:20:15 +0000 (11:20 -0700)]
runtime: use a pipe to wake up signal_recv on Darwin

The implementation of semaphores, and therefore notes, used on Darwin
is not async-signal-safe. The runtime has one case where a note needs
to be woken up from a signal handler: the call to notewakeup in sigsend.
That notewakeup call is only called on a single note, and it doesn't
need the full functionality of notes: nothing ever does a timed wait on it.
So change that one note to use a different implementation on Darwin,
based on a pipe. This lets the wakeup code use the write call, which is
async-signal-safe.

Fixes #31264

Change-Id: If705072d7a961dd908ea9d639c8d12b222c64806
Reviewed-on: https://go-review.googlesource.com/c/go/+/184169
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
4 years agocrypto/tls: deflake localPipe in tests
Russ Cox [Fri, 28 Jun 2019 00:54:14 +0000 (20:54 -0400)]
crypto/tls: deflake localPipe in tests

The localPipe implementation assumes that every successful net.Dial
results in exactly one successful listener.Accept. I don't believe this
is guaranteed by essentially any operating system. For this test, we're
seeing flakes on dragonfly (#29583).

But see also #19519, flakes due to the same assumption on FreeBSD
and macOS in package net's own tests.

This CL rewrites localPipe to try a few times to get a matching pair
of connections on the dial and accept side.

Fixes #29583.

Change-Id: Idb045b18c404eae457f091df20456c5ae879a291
Reviewed-on: https://go-review.googlesource.com/c/go/+/184157
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agonet: deflake TestVariousDeadlines
Russ Cox [Fri, 28 Jun 2019 00:30:28 +0000 (20:30 -0400)]
net: deflake TestVariousDeadlines

TestVariousDeadlines starts a client and server.
The client dials the server, sets a timeout on the connection,
reads from it, gets a timeout error, closes the connection.
The server writes an infinite stream of a's to each connection
it accepts.

The test was trying to run these in lockstep:
run a client dial+read+timeout+close,
wait for server to accept+write+error out on write to closed connection,
repeat.

On FreeBSD 11.2 and less frequently on macOS we see
the test timeout waiting for the server to do its half of
the lockstep dance.

I believe the problem is that the client can do its step
of the dance with such a short timeout that the read,
timeout, and close happens before the server ever returns
from the accept(2) system call. For the purposes of testing
the client-side read timeout, this is fine. But I suspect
that under some circumstances, the "TCP-accepted"
connection does not translate into a "socket-layer-accepted"
connection that triggers a return from accept(2).
That is, the Go server never sees the connection at all.
And the test sits there waiting for it to acknowledge
being done with a connection it never started with.

Fix the problem by not trying to lockstep with the server.

This definitely fixes the flake, since the specific line that
was calling t.Fatal is now deleted.

This exposes a different flake, seen on a trybot run for an
early version of this CL, in which the client's io.Copy does
not stop within the time allotted. The problem now is that
there is no guarantee that a read beyond the deadline with
available data returns an error instead of the available data,
yet the test assumes this guarantee, and in fact the opposite
is usually true - we don't bother checking the deadline unless
the read needs to block. That is, deadlines don't cut off a
flood of available data, yet this test thinks they do.

This CL therefore also changes the server not to send an
infinite flood of data - don't send any data at all - so that
the read deadline is guaranteed to be exercised.

Fixes #19519.

Change-Id: I58057c3ed94ac2aebab140ea597f317abae6e65e
Reviewed-on: https://go-review.googlesource.com/c/go/+/184137
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agoruntime: fix pprof cpu profile corruption on arm/mips/mipsle
Russ Cox [Fri, 28 Jun 2019 05:42:08 +0000 (01:42 -0400)]
runtime: fix pprof cpu profile corruption on arm/mips/mipsle

CL 42652 changed the profile handler for mips/mipsle to
avoid recording a profile when in atomic functions, for fear
of interrupting the 32-bit simulation of a 64-bit atomic with
a lock. The profile logger itself uses 64-bit atomics and might
deadlock (#20146).

The change was to accumulate a count of dropped profile events
and then send the count when the next ordinary event was sent:

if prof.hz != 0 {
+ if (GOARCH == "mips" || GOARCH == "mipsle") && lostAtomic64Count > 0 {
+ cpuprof.addLostAtomic64(lostAtomic64Count)
+ lostAtomic64Count = 0
+ }
  cpuprof.add(gp, stk[:n])
  }

CL 117057 extended this behavior to include GOARCH == "arm".

Unfortunately, the inserted cpuprof.addLostAtomic64 differs from
the original cpuprof.add in that it neglects to acquire the lock
protecting the profile buffer.

This has caused a steady stream of flakes on the arm builders
for the past 12 months, ever since CL 117057 landed.

This CL moves the lostAtomic count into the profile buffer and
then lets the existing addExtra calls take care of it, instead of
duplicating the locking logic.

Fixes #24991.

Change-Id: Ia386c40034fcf46b31f080ce18f2420df4bb8004
Reviewed-on: https://go-review.googlesource.com/c/go/+/184164
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
4 years agocmd/doc: provide working directory to build.Import calls
Dmitri Shuralyov [Thu, 27 Jun 2019 00:07:14 +0000 (20:07 -0400)]
cmd/doc: provide working directory to build.Import calls

The current cmd/doc implementation uses go/build.Import in a few
places to check whether a package is findable and importable.
go/build has limited support for finding packages in modules,
but to do so, build.Import requires knowing the source directory
to use when performing the lookup (so it can find the go.mod file).
Otherwise, it only looks inside the GOPATH workspace.

Start passing the current working directory to build.Import calls,
so that it can correctly look for packages in modules when in cmd/doc
is executed in module mode.

Before this change, cmd/doc in module mode could mistakenly find and
use a package in the GOPATH workspace, instead of the current module.

Since the result of os.Getwd is needed in even more places, assign it
to a local variable in parseArgs now.

Fixes #28992
Updates #26504

Change-Id: I7571618e18420d2d3b3890cc69ade2d97b1962bf
Reviewed-on: https://go-review.googlesource.com/c/go/+/183991
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agodoc: fix spec links in Go 1.13 release notes
Diogo Pinela [Thu, 27 Jun 2019 21:19:15 +0000 (22:19 +0100)]
doc: fix spec links in Go 1.13 release notes

When reading tip.golang.org/doc/go1.13.html, the spec links in
the "Changes to the language" section should point to the updated
spec, not the old one.

Change-Id: I6b13ca0b4c722ed52b84a12a680bece876a4e478
Reviewed-on: https://go-review.googlesource.com/c/go/+/184118
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
4 years agotext/scanner: remove AllowDigitSeparator flag again
Robert Griesemer [Thu, 27 Jun 2019 20:26:51 +0000 (13:26 -0700)]
text/scanner: remove AllowDigitSeparator flag again

The scanner was changed to accept the new Go number literal syntax
of which separators are a part. Making them opt-in is inconsistent
with the rest of the changes. For comparison, the strconv package
also accepts the new number literals including separators with the
various conversion routines, if no explicit number base is given.

Updates #28493.

Change-Id: Ifaae2225a9565364610813658bfe692901dd3ccd
Reviewed-on: https://go-review.googlesource.com/c/go/+/184080
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
4 years agogo/importer: update documentation on ForCompiler lookup parameter
Robert Griesemer [Thu, 27 Jun 2019 20:17:48 +0000 (13:17 -0700)]
go/importer: update documentation on ForCompiler lookup parameter

Change-Id: I80dff181a79858b52ba77c3f38f77a744b423afa
Reviewed-on: https://go-review.googlesource.com/c/go/+/184079
Reviewed-by: Michael Matloob <matloob@golang.org>
4 years agogo/build: don't check if srcDir in GOPATH when deciding to use modules
Jay Conrod [Thu, 27 Jun 2019 19:28:08 +0000 (15:28 -0400)]
go/build: don't check if srcDir in GOPATH when deciding to use modules

go/build.Context.Import loads package information using 'go list' when
in module mode. It does this when GO111MODULE is not "off", there is a
go.mod file in any parent directory, and neither the path nor the
source directory are in GOROOT. Import no longer checks whether the
source directory is in GOPATH if GO111MODULE=auto or unset.

Also fixed subdirectory checks that did not handle relative source
directory paths. mod_gobuild_import should have failed when we changed
the meaning of GO111MODULE=auto but didn't because of this.

Fixes #32799

Change-Id: Ic5210b7e00cb58f91ea9455b67b49d5aed4eec63
Reviewed-on: https://go-review.googlesource.com/c/go/+/184098
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

4 years agomisc/cgo/errors: align code snippets in ptr_test.go
Bryan C. Mills [Wed, 26 Jun 2019 19:00:01 +0000 (15:00 -0400)]
misc/cgo/errors: align code snippets in ptr_test.go

Change-Id: Ic3e2819617375df653116d21d7361a46085250d5
Reviewed-on: https://go-review.googlesource.com/c/go/+/183986
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agoRevert "syscall: use Ctty before fd shuffle"
Damien Neil [Wed, 26 Jun 2019 17:09:14 +0000 (17:09 +0000)]
Revert "syscall: use Ctty before fd shuffle"

This reverts commit 103b5b66921b351f8db4fc6e83bf147b1a0d7580.

Reason for revert: Breaks valid existing programs.

Updates #29458

Change-Id: I7ace4ae404cf2a8b0e15e646663c50115f74b758
Reviewed-on: https://go-review.googlesource.com/c/go/+/183939
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Greg Thelen <gthelen@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agofmt: fix typo in errors.go
Baokun Lee [Thu, 27 Jun 2019 03:49:43 +0000 (11:49 +0800)]
fmt: fix typo in errors.go

Fixes #32802

Change-Id: I756ca49285130b45777bd29de440db296d9632e9
Reviewed-on: https://go-review.googlesource.com/c/go/+/184057
Run-TryBot: Baokun Lee <nototon@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years agocmd/go: fix typo in sumdb cache path
Heschi Kreinick [Fri, 21 Jun 2019 19:43:23 +0000 (15:43 -0400)]
cmd/go: fix typo in sumdb cache path

Put the sumdb cache in the usual pkg/mod/cache/download dir, rather
than the new pkg/mod/download/cache dir which I presume was a typo.

Change-Id: Id162f24db30f509353178ca0c8cc7a4dabc927e1
Reviewed-on: https://go-review.googlesource.com/c/go/+/183318
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agomisc/cgo/errors: fix TestPointerChecks when GO111MODULE=on
Bryan C. Mills [Wed, 26 Jun 2019 19:25:16 +0000 (15:25 -0400)]
misc/cgo/errors: fix TestPointerChecks when GO111MODULE=on

Change-Id: I4e9e46f03c9c43df1d0c6995f3baedd2e1a04c6a
Reviewed-on: https://go-review.googlesource.com/c/go/+/183985
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agodoc/go1.13: make cmd/go paragraphs more concise
Bryan C. Mills [Wed, 26 Jun 2019 19:57:25 +0000 (15:57 -0400)]
doc/go1.13: make cmd/go paragraphs more concise

Looking at the live release notes on tip.golang.org, the Modules
section is much more verbose than the other sections.

To some extent that's to be expected, but too much detail in the
release notes might discourage folks from consulting the actual
documentation. Ensure that topics have clear links and omit
unnecessary details.

Change-Id: I1ccbc1697fccaf7ca7094c606bd11696c46d87f0
Reviewed-on: https://go-review.googlesource.com/c/go/+/183987
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

4 years agodoc/go1.13: describe new 'go version' behavior
Jay Conrod [Wed, 26 Jun 2019 19:21:38 +0000 (15:21 -0400)]
doc/go1.13: describe new 'go version' behavior

Change-Id: I18e2546f89e68e77d6e829acc997851751a44f0c
Reviewed-on: https://go-review.googlesource.com/c/go/+/183983
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agosync: only check for successful PopHeads in long mode
Austin Clements [Wed, 26 Jun 2019 18:35:05 +0000 (14:35 -0400)]
sync: only check for successful PopHeads in long mode

In TestPoolDequeue it's surprisingly common for the queue to stay
nearly empty the whole time and for a racing PopTail to happen in the
window between the producer doing a PushHead and doing a PopHead. In
short mode, there are only 100 PopTail attempts. On linux/amd64, it's
not uncommon for this to fail 50% of the time. On linux/arm64, it's
not uncommon for this to fail 100% of the time, causing the test to
fail.

This CL fixes this by only checking for a successful PopTail in long
mode. Long mode makes 200,000 PopTail attempts, and has never been
observed to fail.

Fixes #31422.

Change-Id: If464d55eb94fcb0b8d78fbc441d35be9f056a290
Reviewed-on: https://go-review.googlesource.com/c/go/+/183981
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agosync: make TestPoolDequeue termination condition more robust
Austin Clements [Wed, 26 Jun 2019 17:20:05 +0000 (13:20 -0400)]
sync: make TestPoolDequeue termination condition more robust

TestPoolDequeue creates P-1 consumer goroutines and 1 producer
goroutine. Currently, if a consumer goroutine pops the last value from
the dequeue, it sets a flag that stops all consumers, but the producer
also periodically pops from the dequeue and doesn't set this flag.

Hence, if the producer were to pop the last element, the consumers
will continue to run and the test won't terminate. This CL fixes this
by also setting the termination flag in the producer.

I believe it's impossible for this to happen right now because the
producer only pops after pushing an element for which j%10==0 and the
last element is either 999 or 1999999, which means it should never try
to pop after pushing the last element. However, we shouldn't depend on
this reasoning.

Change-Id: Icd2bc8d7cb9a79ebfcec99e367c8a2ba76e027d8
Reviewed-on: https://go-review.googlesource.com/c/go/+/183980
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agosync: fix pool wrap-around test
Austin Clements [Wed, 26 Jun 2019 15:11:45 +0000 (11:11 -0400)]
sync: fix pool wrap-around test

TestPoolDequeue in long mode does a little more than 1<<21 pushes.
This was originally because the head and tail indexes were 21 bits and
the intent was to test wrap-around behavior. However, in the final
version they were both 32 bits, so the test no longer tested
wrap-around.

It would take too long to reach 32-bit wrap around in a test, so
instead we initialize the poolDequeue with indexes that are already
nearly at their limit. This keeps the knowledge of the maximum index
in one place, and lets us test wrap-around even in short mode.

Change-Id: Ib9b8d85b6d9b5be235849c2b32e81c809e806579
Reviewed-on: https://go-review.googlesource.com/c/go/+/183979
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agocmd/go/internal/modfetch: halt proxy fallback if the proxy returns a non-404/410...
Bryan C. Mills [Tue, 25 Jun 2019 21:13:21 +0000 (17:13 -0400)]
cmd/go/internal/modfetch: halt proxy fallback if the proxy returns a non-404/410 response for @latest

The @latest proxy endpoint is optional. If a proxy returns a 404 for
it, and returns an @v/list with no matching versions, then we should
allow module lookup to try other module paths. However, if the proxy
returns some other error (say, a 403 or 505), then the result of the
lookup is ambiguous, and we should report the actual error rather than
"no matching versions for query".

(This fix was prompted by discussion with Dmitri on CL 183619.)

Updates #32715
Updates #26334

Change-Id: I6d510a5ac24d48d9bc5037c3c747ac50695c663f
Reviewed-on: https://go-review.googlesource.com/c/go/+/183845
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agocmd/go/internal/modfetch/codehost: don't try to execute a nonexistent fetch function
Bryan C. Mills [Wed, 26 Jun 2019 13:22:08 +0000 (09:22 -0400)]
cmd/go/internal/modfetch/codehost: don't try to execute a nonexistent fetch function

This fixes a panic observed in
https://build.golang.org/log/1242a032cac29fd3dffb24055fdeff0202b546be.

Change-Id: I029b9d69cabb87091734bd33d7fd39d30b12f9c5
Reviewed-on: https://go-review.googlesource.com/c/go/+/183917
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agocmd/go: move mod_get_svn test to vcs-test.golang.org
Bryan C. Mills [Tue, 25 Jun 2019 21:51:47 +0000 (17:51 -0400)]
cmd/go: move mod_get_svn test to vcs-test.golang.org

The test currently usses llvm.org, which seems to be very flaky today.

Change-Id: I3d01476d53f94d9170dbb087e3f3cf99581cdb4d
Reviewed-on: https://go-review.googlesource.com/c/go/+/183847
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agodoc/go1.13: move 'go get -t' paragraph to be adjacent to 'go get -u' changes
Bryan C. Mills [Wed, 26 Jun 2019 14:07:13 +0000 (10:07 -0400)]
doc/go1.13: move 'go get -t' paragraph to be adjacent to 'go get -u' changes

As suggested by thepudds in CL 183630.

Also adjust the paragraph to harmonize the transitions between the
newly-adjacent paragraphs.

Change-Id: Ie85abea946db81804c1995d27be4951d5db6b812
Reviewed-on: https://go-review.googlesource.com/c/go/+/183918
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agodoc/go1.13: describe the change in behavior of GO111MODULE=auto
Bryan C. Mills [Wed, 26 Jun 2019 17:16:50 +0000 (13:16 -0400)]
doc/go1.13: describe the change in behavior of GO111MODULE=auto

Updates #31857

Change-Id: Id0dc66246f768a2c730c67cd7a4a7830547f22a8
Reviewed-on: https://go-review.googlesource.com/c/go/+/183922
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: Katie Hockman <katie@golang.org>
4 years agoapi: promote next to go1.13 go1.13beta1
Andrew Bonventre [Wed, 26 Jun 2019 14:55:19 +0000 (10:55 -0400)]
api: promote next to go1.13

Change-Id: I394f942822a0db27418d3fbb25df6227ea199a5f
Reviewed-on: https://go-review.googlesource.com/c/go/+/183919
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agocmd/compile, runtime: use R20, R21 in ARM64's Duff's devices
Cherry Zhang [Tue, 25 Jun 2019 18:48:04 +0000 (14:48 -0400)]
cmd/compile, runtime: use R20, R21 in ARM64's Duff's devices

Currently we use R16 and R17 for ARM64's Duff's devices.
According to ARM64 ABI, R16 and R17 can be used by the (external)
linker as scratch registers in trampolines. So don't use these
registers to pass information across functions.

It seems unlikely that calling Duff's devices would need a
trampoline in normal cases. But it could happen if the call
target is out of the 128 MB direct jump limit.

The choice of R20 and R21 is kind of arbitrary. The register
allocator allocates from low-numbered registers. High numbered
registers are chosen so it is unlikely to hold a live value and
forces a spill.

Fixes #32773.

Change-Id: Id22d555b5afeadd4efcf62797d1580d641c39218
Reviewed-on: https://go-review.googlesource.com/c/go/+/183842
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
4 years agocmd/go: 'go get' should not delete binaries when run from $GOBIN
Jay Conrod [Tue, 25 Jun 2019 21:25:01 +0000 (17:25 -0400)]
cmd/go: 'go get' should not delete binaries when run from $GOBIN

When 'go install' is run without arguments in a directory containing a
main package, it deletes an executable file with the same name as the
package (presumably created by 'go build' previously).

'go get' in module mode executes the same code after updating and
downloading modules. However, the special case was misfiring because
we passed an empty list of patterns to InstallPackages.

Fixes #32766

Change-Id: I19aca64ee1fb5a216777dd7d559e8e6a45b3e90c
Reviewed-on: https://go-review.googlesource.com/c/go/+/183846
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agosyscall: fix nil pointer dereference in Getdirentries on 32-bit freebsd 12
Tobias Klauser [Tue, 25 Jun 2019 12:06:14 +0000 (14:06 +0200)]
syscall: fix nil pointer dereference in Getdirentries on 32-bit freebsd 12

Don't attempt to dereference basep if it's nil, just pass it to
getdirentries_freebsd12 as is.

Ported from x/sys/unix CL 183223

Change-Id: Id1c4e0eb6ff36dd39524da8194fed9a5957bce61
Reviewed-on: https://go-review.googlesource.com/c/go/+/183797
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agogo/types: avoid race condition with dot-imported objects
Robert Griesemer [Tue, 25 Jun 2019 22:46:23 +0000 (15:46 -0700)]
go/types: avoid race condition with dot-imported objects

It would be nice to have a test, but it requires running
this under the race detector which is a bit complicated
to set up; yet the fix is trivial. Verified manually that
it doesn't trip the race detector.

Fixes #32154.

Change-Id: I20bd746a07945c802f0476a1d8b1dfd83c87dae8
Reviewed-on: https://go-review.googlesource.com/c/go/+/183849
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agomisc/cgo/test: use char, not int, so test works on big-endian systems
Ian Lance Taylor [Tue, 25 Jun 2019 17:58:47 +0000 (10:58 -0700)]
misc/cgo/test: use char, not int, so test works on big-endian systems

Updates #32579
Fixes #32770

Change-Id: I32d1dea7505e8ad22e11a9806e10d096924b729b
Reviewed-on: https://go-review.googlesource.com/c/go/+/183778
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
4 years agocmd/compile: don't mark argument array as noalg
Keith Randall [Fri, 14 Jun 2019 02:11:25 +0000 (19:11 -0700)]
cmd/compile: don't mark argument array as noalg

It ends up making two similar types, [N]uint8 of both
alg and noalg varieties. Comparsions between the two then
don't come out equal when they should.
In particular, the type *[N]uint8 has an Elem pointer which
must point to one of the above two types; it can't point to both.
Thus allocating a *[N]uint8 and dereferencing it might be a
different type than a [N]uint8.

The fix is easy. Making a small test for this is really hard. It
requires that both a argless defer and the test be imported by a
common parent package. This is why a main binary doesn't see this
issue, but a test does (as Agniva noticed), because there's a wrapper
package that imports both the test and the defer.

Types like [N]uint8 don't really need to be marked noalg anyway,
as the generated code (if any) will be shared among all
vanilla memory types of the same size.

Fixes #32595

Change-Id: If7b77fa6ed56cd4495601c3f90170682d853b82f
Reviewed-on: https://go-review.googlesource.com/c/go/+/182357
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

4 years agodoc/go1.13: binary-only package are no longer supported
Jay Conrod [Mon, 24 Jun 2019 23:04:15 +0000 (19:04 -0400)]
doc/go1.13: binary-only package are no longer supported

Change-Id: Ieb4a78730a0685627b4730381b72cbd01031c8fa
Reviewed-on: https://go-review.googlesource.com/c/go/+/183633
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agodoc/go1.13: close <em> and <code> tags
Dmitri Shuralyov [Tue, 25 Jun 2019 18:57:50 +0000 (14:57 -0400)]
doc/go1.13: close <em> and <code> tags

Fixup for two typos from CL 183630.

Change-Id: I7968a736680e8a6bbd1f4691d443b217702bc190
Reviewed-on: https://go-review.googlesource.com/c/go/+/183843
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agodoc/go1.13: describe new cmd/go environment variables
Bryan C. Mills [Mon, 24 Jun 2019 21:49:36 +0000 (17:49 -0400)]
doc/go1.13: describe new cmd/go environment variables

Change-Id: I99669339b816a3ae56bbe082a8c47ae17e763d71
Reviewed-on: https://go-review.googlesource.com/c/go/+/183632
Reviewed-by: Katie Hockman <katie@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agodoc/go1.13: describe 'go env -w'
Bryan C. Mills [Mon, 24 Jun 2019 22:03:57 +0000 (18:03 -0400)]
doc/go1.13: describe 'go env -w'

Change-Id: I0c8c30b40a33763dc34f15d144346eb1a0997df2
Reviewed-on: https://go-review.googlesource.com/c/go/+/183631
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agodoc/go1.13: describe changes to 'go get'
Bryan C. Mills [Mon, 24 Jun 2019 21:47:52 +0000 (17:47 -0400)]
doc/go1.13: describe changes to 'go get'

Also fix up markup in the “Version validation” section to correct
indentation on Chrome.

Change-Id: Ib930d324567c086bbd0c67b105272bdfcca77b12
Reviewed-on: https://go-review.googlesource.com/c/go/+/183630
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agocmd/internal/obj/ppc64: add doc.go
Lynn Boger [Mon, 24 Jun 2019 20:30:30 +0000 (16:30 -0400)]
cmd/internal/obj/ppc64: add doc.go

Adding some details on writing Go assembler for ppc64.

Change-Id: I46fc6b75ee6c36946f90280b2b670e0d32bcc6b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/183837
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

4 years agocmd/go: validate path in mod init path
LE Manh Cuong [Mon, 17 Jun 2019 04:07:39 +0000 (11:07 +0700)]
cmd/go: validate path in mod init path

When mod init with given module path, validate that module path is a
valid import path.

Note that module.CheckImportPath is used, because module.CheckPath
verifies that module path is something that "go get" can fetch, which is
strictly stronger condition than "a valid module path".

Updates #28389
Fixes #32644

Change-Id: Ia60f218dd7d79186f87be723c28a96d6cb63017e
Reviewed-on: https://go-review.googlesource.com/c/go/+/182560
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agocmd/go: ensure that runtime/cgo is not stale in TestExecBuildX
Bryan C. Mills [Tue, 25 Jun 2019 13:17:28 +0000 (09:17 -0400)]
cmd/go: ensure that runtime/cgo is not stale in TestExecBuildX

Fixes #29004

Change-Id: Ifc8330b47fbec6f902057cb9b6db44f2c0082056
Reviewed-on: https://go-review.googlesource.com/c/go/+/183838
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agodoc/go1.13: add release notes for the errors package
Andrew [Mon, 24 Jun 2019 19:28:00 +0000 (15:28 -0400)]
doc/go1.13: add release notes for the errors package

Also removes remaining TODOs

Change-Id: Id80021b7a64c923c4ebd69fb6e8831a43a76dc72
Reviewed-on: https://go-review.googlesource.com/c/go/+/183625
Reviewed-by: Katie Hockman <katie@golang.org>
4 years agocmd/go/internal/modfetch: filter pseudo-versions from proxy /list endpoints
Bryan C. Mills [Fri, 21 Jun 2019 19:13:10 +0000 (15:13 -0400)]
cmd/go/internal/modfetch: filter pseudo-versions from proxy /list endpoints

The /list files in the module cache include pseudo-versions, but the
documentation for (*modfetch).Repo.Versions explicitly states that
they are not included in the output of that method.

Fixes #32715

Change-Id: Ieba1500b91f52b5fa689e70e16dbe3ad40de20f7
Reviewed-on: https://go-review.googlesource.com/c/go/+/183402
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agocmd/go/internal/modfetch: return structured errors from proxy operations
Bryan C. Mills [Mon, 24 Jun 2019 16:29:28 +0000 (12:29 -0400)]
cmd/go/internal/modfetch: return structured errors from proxy operations

CL 181881 added structured error types for direct fetches.
Use those same structured errors to format proxy errors consistently.

Also ensure that an empty @v/list is treated as equivalent to the module
not existing at all.

Updates #27173
Updates #32715

Change-Id: I203fd8259bc4f28b3389745f1a1fde936b0fa24d
Reviewed-on: https://go-review.googlesource.com/c/go/+/183619
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agoruntime: fix a register save/restore bug in sigtramp of arm-darwin
Ben Shi [Mon, 24 Jun 2019 02:17:40 +0000 (02:17 +0000)]
runtime: fix a register save/restore bug in sigtramp of arm-darwin

In sigtramp of sys_darwin_arm.s, the callee-save register R4 is
saved to the stack, but later R2 is also saved to the save position.

That CL fixes the unexpected lost of the value in R4.

fixes #32744

Change-Id: Ifaeb99f11e4abf0c79bec9da67e0db97c358010c
Reviewed-on: https://go-review.googlesource.com/c/go/+/183517
Run-TryBot: Ben Shi <powerman1st@163.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agobufio: fix ExampleScanner_Bytes comment, add error check
Ian Lance Taylor [Mon, 24 Jun 2019 18:54:15 +0000 (11:54 -0700)]
bufio: fix ExampleScanner_Bytes comment, add error check

Followup to CL 51412.

Change-Id: Ic83c833e2c571cd7c8293d998ff745f181037a61
Reviewed-on: https://go-review.googlesource.com/c/go/+/183657
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
4 years agodoc/go1.13: cmd/go, math/big, and a leftover crypto/x509 release note
Filippo Valsorda [Mon, 24 Jun 2019 17:49:06 +0000 (13:49 -0400)]
doc/go1.13: cmd/go, math/big, and a leftover crypto/x509 release note

Change-Id: I80f2b50c8dd3d3f0fea6ed25fa2581786152d470
Reviewed-on: https://go-review.googlesource.com/c/go/+/183621
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agocmd/go: fix a typo in module-private help text
Bryan C. Mills [Mon, 24 Jun 2019 19:44:05 +0000 (15:44 -0400)]
cmd/go: fix a typo in module-private help text

Change-Id: Idbdcb78d40cf58d7c878cfeaa4a34ab580fe472f
Reviewed-on: https://go-review.googlesource.com/c/go/+/183626
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agocmd/cgo: fix inappropriate array copy
kawakami [Sat, 22 Jun 2019 20:30:24 +0000 (05:30 +0900)]
cmd/cgo: fix inappropriate array copy

Ensure that during rewriting of expressions that take the address of
an array, that we properly recognize *ast.IndexExpr as an operation
to create a pointer variable and thus assign the proper addressOf
and deference operators as "&" and "*" respectively.

This fixes a regression from CL 142884.

Fixed #32579

Change-Id: I3cb78becff4f8035d66fc5536e5b52857eacaa3d
Reviewed-on: https://go-review.googlesource.com/c/go/+/183458
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agocmd/go: silence ar with D flag failures
Clément Chigot [Thu, 13 Jun 2019 08:12:06 +0000 (10:12 +0200)]
cmd/go: silence ar with D flag failures

The first call of ar must not show its output in order to avoid useless
error messages about D flag.

Change-Id: I3a2f5144b3bb271705000b67cd46cd02e98aca77
Reviewed-on: https://go-review.googlesource.com/c/go/+/182077
Run-TryBot: Clément Chigot <clement.chigot@atos.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agodoc/go1.13: mention {NetBSD,OpenBSD}/arm64 ports
Ian Lance Taylor [Mon, 24 Jun 2019 17:02:41 +0000 (10:02 -0700)]
doc/go1.13: mention {NetBSD,OpenBSD}/arm64 ports

Also alphabetize port listing.

Change-Id: I4cc552a74856c9955571d721deb6223438c7d856
Reviewed-on: https://go-review.googlesource.com/c/go/+/183637
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years agocmd/go/internal/modfetch: treat a missing go.mod file as a “not exist” error
Bryan C. Mills [Mon, 24 Jun 2019 14:16:12 +0000 (10:16 -0400)]
cmd/go/internal/modfetch: treat a missing go.mod file as a “not exist” error

If we have found a repository at the requested version but it does not
contain a go.mod file in an appropriate subdirectory, then the module
with the given path does not exist at that version. Therefore, we
should report it with an error equivalent to os.ErrNotExist so that
modload.Query will continue to check other possible module paths.

Updates #27173

Change-Id: Ica73f4bb97f58e611a7f7d38183ee52fef5ee69a
Reviewed-on: https://go-review.googlesource.com/c/go/+/183618
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agodoc/go1.13: remove bytes TODO since it does not require a release note
Andrew [Mon, 24 Jun 2019 14:11:26 +0000 (10:11 -0400)]
doc/go1.13: remove bytes TODO since it does not require a release note

Change-Id: I8c19c6df6fec74dcc8c3bfdc667576ea00e86ec1
Reviewed-on: https://go-review.googlesource.com/c/go/+/183617
Reviewed-by: Katie Hockman <katie@golang.org>
4 years agotest: update blank1.go for changed gofrontend error messages
Ian Lance Taylor [Sat, 22 Jun 2019 19:56:49 +0000 (12:56 -0700)]
test: update blank1.go for changed gofrontend error messages

Adjusting gofrontend error messages for GCC standards causes the
messages expected by this test to be adjusted slightly: the gofrontend
code now quotes the _ identifier.

Change-Id: I55ee2ae70b4da3bf7a421ceea80b254dd17601a9
Reviewed-on: https://go-review.googlesource.com/c/go/+/183477
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
4 years agoruntime/cgo: on Solaris link against -lxnet
Ian Lance Taylor [Fri, 21 Jun 2019 18:50:25 +0000 (11:50 -0700)]
runtime/cgo: on Solaris link against -lxnet

Fixes #32205

Change-Id: If5b1d32a5e19ff5d9337862c07fb77890d19d69f
Reviewed-on: https://go-review.googlesource.com/c/go/+/183379
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
4 years agodoc: add release notes for godoc and go doc
Dmitri Shuralyov [Mon, 17 Jun 2019 20:28:18 +0000 (16:28 -0400)]
doc: add release notes for godoc and go doc

Updates #30029
Updates #31457

Change-Id: I08414a544615e74afb47f7a10a00f1e22adfd40c
Reviewed-on: https://go-review.googlesource.com/c/go/+/182619
Reviewed-by: Katie Hockman <katie@golang.org>
4 years agocmd/go: validate pseudo-versions against module paths and revision metadata
Bryan C. Mills [Tue, 11 Jun 2019 19:49:44 +0000 (15:49 -0400)]
cmd/go: validate pseudo-versions against module paths and revision metadata

Previously, most operations involving pseudo-versions allowed any
arbitrary combination of version string and date, and would resolve to
the underlying revision (typically a Git commit hash) as long as that
revision existed.

There are a number of problems with that approach:

• The pseudo-version participates in minimal version selection. If its
  version prefix is inaccurate, the pseudo-version may appear to have
  higher precedence that the releases that follow it, effectively
  “pinning” the module to that commit. For release tags, module
  authors are the ones who make the decision about release tagging;
  they should also have control over the pseudo-version precedence
  within their module.

• The commit date within the pseudo-version provides a total order
  among pseudo-versions. If it is not accurate, the pseudo-version
  will sort into the wrong place relative to other commits with the
  same version prefix.

To address those problems, this change restricts the pseudo-versions
that the 'go' command accepts, rendering some previously
accepted-but-not-canonical versions invalid. A pseudo-version is now
valid only if all of:

1. The tag from which the pseudo-version derives points to the named
   revision or one of its ancestors as reported by the underlying VCS
   tool, or the pseudo-version is not derived from any tag (that is,
   has a "vX.0.0-" prefix before the date string and uses the lowest
   major version appropriate to the module path).

2. The date string within the pseudo-version matches the UTC timestamp
   of the revision as reported by the underlying VCS tool.

3. The short name of the revision within the pseudo-version (such as a
   Git hash prefix) is the same as the short name reported by the
   underlying cmd/go/internal/modfetch/codehost.Repo. Specifically, if
   the short name is a SHA-1 prefix, it must use the same number of
   hex digits (12) as codehost.ShortenSHA1.

4. The pseudo-version includes a '+incompatible' suffix only if it is
   needed for the corresponding major version, and only if the
   underlying module does not have a go.mod file.

We believe that all releases of the 'go' tool have generated
pseudo-versions that meet these constraints. However, a few
pseudo-versions edited by hand or generated by third-party tools do
not. If we discover invalid-but-benign pseudo-versions in widely-used
existing dependencies, we may choose to add a whitelist for those
specific path/version combinations.



To work around invalid dependencies in leaf modules, users may add a
'replace' directive from the invalid version to its valid equivalent.
Note that the go command's go.mod parser automatically resolves commit
hashes found in 'replace' directives to the appropriate
pseudo-versions, so in most cases one can write something like:

replace github.com/docker/docker v1.14.0-0.20190319215453-e7b5f7dbe98c => github.com/docker/docker e7b5f7dbe98c

and then run any 'go' command (such as 'go list' or 'go mod tidy') to
resolve it to an appropriate pseudo-version. Note that the invalid
version will still be used in minimal version selection, so this use
of 'replace' directives is an incomplete workaround.



One of the common use cases for higher-than-tagged pseudo-versions is
for projects that do parallel development on release branches. For
example, if a project cuts a 'v1.2' release branch at v1.2.0, they may
want future commits on the main branch to show up as pre-releases for
v1.3.0 rather than for v1.2.1 — especially if v1.2.1 is already tagged
on the release branch. (On the other hand, a backport of a patch to
the v1.2 branch should not show up as a pre-release for v1.3.0.)

To address this use-case, module authors can make use of our existing
support for pseudo-versions derived from pre-release tags: if the
author adds an explicit pre-release tag (such as 'v1.3.0-devel') to
the first commit after the branch, then the pseudo-versions for that
commit and its descendents will be derived from that tag and will sort
appropriately in version selection.



Updates #27171
Fixes #29262
Fixes #27173
Fixes #32662
Fixes #32695

Change-Id: I0d50a538b6fdb0d3080aca9c9c3df1040da1b329
Reviewed-on: https://go-review.googlesource.com/c/go/+/181881
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agocmd/go/testdata: update addmod.go to work with the mainline go command
Bryan C. Mills [Fri, 21 Jun 2019 19:03:57 +0000 (15:03 -0400)]
cmd/go/testdata: update addmod.go to work with the mainline go command

Updates #32715

Change-Id: I4ea41d7bd1a2daeba8cebb283aaa096b6c3d4533
Reviewed-on: https://go-review.googlesource.com/c/go/+/183401
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years agocmd/gofmt: fix normalization of imaginary number literals
Robert Griesemer [Fri, 21 Jun 2019 16:06:56 +0000 (09:06 -0700)]
cmd/gofmt: fix normalization of imaginary number literals

The old code only normalized decimal integer imaginary number
literals. But with the generalized imaginary number syntax,
the number value may be decimal, binary, octal, or hexadecimal,
integer or floating-point.

The new code only looks at the number pattern. Only for decimal
integer imaginary literals do we need to strip leading zeroes.
The remaining normalization code simply ignore the 'i' suffix.
As a result, the new code is both simpler and shorter.

Fixes #32718.

Change-Id: If43fc962a48ed62002e65d5c81fddbb9bd283984
Reviewed-on: https://go-review.googlesource.com/c/go/+/183378
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agocmd/link: revise previous __DWARF segment protection fix
Than McIntosh [Thu, 20 Jun 2019 13:02:05 +0000 (09:02 -0400)]
cmd/link: revise previous __DWARF segment protection fix

Tweak the previous fix for issue 32673 (in CL 182958) to work around
problems with c-shared build mode that crop up on some of the builders
(10.11, 10.12).  We now consistently set vmaddr and vmsize to zero
for the DWARF segment regardless of build mode.

Updates #32673

Change-Id: Id1fc213590ad00c28352925e2d754d760e022b5e
Reviewed-on: https://go-review.googlesource.com/c/go/+/183237
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: David Chase <drchase@google.com>
4 years agocmd/go: add more docs for go directive in go.mod file
Ian Lance Taylor [Wed, 12 Jun 2019 14:01:04 +0000 (07:01 -0700)]
cmd/go: add more docs for go directive in go.mod file

Updates #30791

Change-Id: I67efd7fd3b3a550428b16518bb27a3d81c178d28
Reviewed-on: https://go-review.googlesource.com/c/go/+/181840
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agobufio: add example for Scanner.Bytes
guitarbum722 [Thu, 27 Jul 2017 03:26:18 +0000 (20:26 -0700)]
bufio: add example for Scanner.Bytes

Change-Id: I4a5c7573e13dd85531ee9f4dd2a0d1981bf8cdfa
Reviewed-on: https://go-review.googlesource.com/c/go/+/51412
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agoRevert "runtime: use dispatch semaphores on Darwin"
Ian Lance Taylor [Wed, 19 Jun 2019 17:48:33 +0000 (17:48 +0000)]
Revert "runtime: use dispatch semaphores on Darwin"

This reverts https://golang.org/cl/182258.

The new code caused unpredictable crashes that are not understood.  The old code was occasionally flaky but still better than this approach.

Fixes #32655
Updates #31264

Change-Id: I2e9d27d6052e84bf75106d8b844549ba4f571695
Reviewed-on: https://go-review.googlesource.com/c/go/+/182880
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
4 years agodoc/go1.13: document changes to gofmt, go/* libs, and fix entry for text/scanner
Robert Griesemer [Thu, 20 Jun 2019 23:50:48 +0000 (16:50 -0700)]
doc/go1.13: document changes to gofmt, go/* libs, and fix entry for text/scanner

Change-Id: I2230a97c681406f248b7f2fff45dd80a4b54a4b3
Reviewed-on: https://go-review.googlesource.com/c/go/+/183357
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agobufio: Reader.Read may return io.EOF even when it has data buffered
Daniel Cormier [Wed, 19 Jun 2019 16:32:30 +0000 (12:32 -0400)]
bufio: Reader.Read may return io.EOF even when it has data buffered

If reading 0 bytes, don't return the error from the underlying
io.Reader if there is still data buffered.

Fixes #32693

Change-Id: I12a97bd6003c638c15d41028942f27edf88340e2
Reviewed-on: https://go-review.googlesource.com/c/go/+/182997
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
4 years agocrypto/x509: normalize and expand docs of Parse and Marshal functions
Filippo Valsorda [Thu, 20 Jun 2019 01:13:20 +0000 (21:13 -0400)]
crypto/x509: normalize and expand docs of Parse and Marshal functions

Change-Id: I8f0e109053bbbd8bde4fa64059fd070d8f4acef2
Reviewed-on: https://go-review.googlesource.com/c/go/+/183117
Reviewed-by: Adam Langley <agl@golang.org>
4 years agocrypto/tls: reject low-order Curve25519 points
Filippo Valsorda [Wed, 19 Jun 2019 22:31:43 +0000 (18:31 -0400)]
crypto/tls: reject low-order Curve25519 points

The RFC recommends checking the X25519 output to ensure it's not the
zero value, to guard against peers trying to remove contributory
behavior.

In TLS there should be enough transcript involvement to mitigate any
attack, and the RSA key exchange would suffer from the same issues by
design, so not proposing a backport.

See #31846

Change-Id: I8e657f8ee8aa72c3f8ca3b124555202638c53f5e
Reviewed-on: https://go-review.googlesource.com/c/go/+/183039
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
4 years agocrypto/tls: move shared code and resources to handshake_test.go
Filippo Valsorda [Wed, 19 Jun 2019 21:07:26 +0000 (17:07 -0400)]
crypto/tls: move shared code and resources to handshake_test.go

Removed cross-dependencies between handshake_server_test.go and
handshake_client_test.go; moved all initialization to TestMain; replaced
SSLKEYLOGFILE environment variable with -keylog flag.

Change-Id: Ida6712daa44e01a2c00658e8a1896087ee88bcb0
Reviewed-on: https://go-review.googlesource.com/c/go/+/183057
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
4 years agotext/scanner: rename AllowNumberbars to AllowDigitSeparators
Robert Griesemer [Wed, 19 Jun 2019 22:50:06 +0000 (15:50 -0700)]
text/scanner: rename AllowNumberbars to AllowDigitSeparators

Fixes #32661.

Change-Id: I32dc4e7b276b95ac2e87a384caa6c48702368d05
Reviewed-on: https://go-review.googlesource.com/c/go/+/183077
Reviewed-by: Andrew Bonventre <andybons@golang.org>
4 years agocmd/go/internal/imports: match solaris files for illumos
Tobias Klauser [Sat, 1 Jun 2019 22:51:46 +0000 (00:51 +0200)]
cmd/go/internal/imports: match solaris files for illumos

Like the android/linux pair, match files with GOOS=solaris if
GOOS=illumos

Follow-up for CL 174457

Fixes #32370
Updates #20603

Change-Id: Id01de8bb3990d7bbb22f735a4abed2b3cf8b4062
Reviewed-on: https://go-review.googlesource.com/c/go/+/179997
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agocmd/compile: add necessary operand to mergePoint in rewrite rules
David Chase [Wed, 19 Jun 2019 22:09:39 +0000 (18:09 -0400)]
cmd/compile: add necessary operand to mergePoint in rewrite rules

A missing operand to mergePoint caused lower to place values
in the wrong blocks.

Includes test, belt+suspenders to do both ssa check and verify
the output (was is how the bug was originally observed).

The fixed bug here is very likely present in Go versions
1.9-1.12 on amd64 and s390x

Fixes #32680.

Change-Id: I63e702c4c40602cb795ef71b1691eb704d38ccc7
Reviewed-on: https://go-review.googlesource.com/c/go/+/183059
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
4 years agocmd/go: install binaries in cmd/ in $GOROOT/bin instead of $GOBIN
Jay Conrod [Wed, 19 Jun 2019 21:25:27 +0000 (17:25 -0400)]
cmd/go: install binaries in cmd/ in $GOROOT/bin instead of $GOBIN

This was caused by CL 167748, which removed a special case for command
line arguments starting with "cmd/". This CL restores the behavior
from go1.12.

Fixes #32674

Change-Id: I72180d11fb0261ef0af9632e512bd9c03481b6c0
Reviewed-on: https://go-review.googlesource.com/c/go/+/183058
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agodoc/go1.13: add release notes for the testing package
Andrew [Tue, 18 Jun 2019 17:32:04 +0000 (13:32 -0400)]
doc/go1.13: add release notes for the testing package

Change-Id: I4ddbe22061579383ca47e14d0b64a74365fb3d19
Reviewed-on: https://go-review.googlesource.com/c/go/+/182797
Reviewed-by: Katie Hockman <katie@golang.org>
4 years agocrypto/tls: disable RSA-PSS in TLS 1.2 again
Filippo Valsorda [Thu, 13 Jun 2019 22:33:33 +0000 (18:33 -0400)]
crypto/tls: disable RSA-PSS in TLS 1.2 again

Signing with RSA-PSS can uncover faulty crypto.Signer implementations,
and it can fail for (broken) small keys. We'll have to take that
breakage eventually, but it would be nice for it to be opt-out at first.

TLS 1.3 requires RSA-PSS and is opt-out in Go 1.13. Instead of making a
TLS 1.3 opt-out influence a TLS 1.2 behavior, let's wait to add RSA-PSS
to TLS 1.2 until TLS 1.3 is on without opt-out.

Note that since the Client Hello is sent before a protocol version is
selected, we have to advertise RSA-PSS there to support TLS 1.3.
That means that we still support RSA-PSS on the client in TLS 1.2 for
verifying server certificates, which is fine, as all issues arise on the
signing side. We have to be careful not to pick (or consider available)
RSA-PSS on the client for client certificates, though.

We'd expect tests to change only in TLS 1.2:

    * the server won't pick PSS to sign the key exchange
      (Server-TLSv12-* w/ RSA, TestHandshakeServerRSAPSS);
    * the server won't advertise PSS in CertificateRequest
      (Server-TLSv12-ClientAuthRequested*, TestClientAuth);
    * and the client won't pick PSS for its CertificateVerify
      (Client-TLSv12-ClientCert-RSA-*, TestHandshakeClientCertRSAPSS,
      Client-TLSv12-Renegotiate* because "R" requests a client cert).

Client-TLSv13-ClientCert-RSA-RSAPSS was updated because of a fix in the test.

This effectively reverts 88343530720a52c96b21f2bd5488c8fb607605d7.

Testing was made more complex by the undocumented semantics of OpenSSL's
-[client_]sigalgs (see openssl/openssl#9172).

Updates #32425

Change-Id: Iaddeb2df1f5c75cd090cc8321df2ac8e8e7db349
Reviewed-on: https://go-review.googlesource.com/c/go/+/182339
Reviewed-by: Adam Langley <agl@golang.org>
4 years agodoc/go1.13: expand ports, add skeleton language changes section
Austin Clements [Tue, 18 Jun 2019 21:42:44 +0000 (17:42 -0400)]
doc/go1.13: expand ports, add skeleton language changes section

Change-Id: I6338bba2a86fb27421f91203a04b39830bae1e52
Reviewed-on: https://go-review.googlesource.com/c/go/+/182800
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agocmd/link: macos: set initial protection of 0 for __DWARF segment
Than McIntosh [Wed, 19 Jun 2019 17:33:33 +0000 (13:33 -0400)]
cmd/link: macos: set initial protection of 0 for __DWARF segment

For later versions of MacOS, the dynamic loader is more picky about
enforcing restrictions on __DWARF MachO load commands/segments,
triggering aborts of the form

  dyld: malformed mach-o image: segment __DWARF has vmsize < filesize

for Go programs that use cgo on Darwin. The error is being triggered
because the Go linker is setting "vmsize" in the DWARF segment entry
to zero as a way to signal that the DWARF doesn't need to be mapped
into memory at runtime (which we need to continue to do).

This patch changes the initial protection on the __DWARF segment to
zero, which dyld seems to be happy with (this is used for other similar
non-loadable sections such as __LLVM).

Fixes #32673

Change-Id: I9a73449c6d26c172f3d70361719943af381f37e6
Reviewed-on: https://go-review.googlesource.com/c/go/+/182958
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
4 years agocmd/compile: correct comments of gc.Val fields
LE Manh Cuong [Mon, 17 Jun 2019 18:14:22 +0000 (01:14 +0700)]
cmd/compile: correct comments of gc.Val fields

Refer to Val.Ctype method instead of non-existed n.ValCtype one.

Change-Id: Ie0fbcae87d9f4f97632865676309d98e0b5138c4
Reviewed-on: https://go-review.googlesource.com/c/go/+/182561
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
4 years agodoc/go1.13: add release notes for language changes
Robert Griesemer [Wed, 19 Jun 2019 00:40:09 +0000 (17:40 -0700)]
doc/go1.13: add release notes for language changes

Change-Id: I17b156e77f279e1387ad27ab0e41ae8f50c9a325
Reviewed-on: https://go-review.googlesource.com/c/go/+/182857
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
4 years agocmd/link: fix stale link to MachO file format reference in comment
Than McIntosh [Wed, 19 Jun 2019 15:41:54 +0000 (11:41 -0400)]
cmd/link: fix stale link to MachO file format reference in comment

Fix a stale reference to Apple's Mach-O file format reference in the
header comment.

Change-Id: I5f120fd5bf31ee0b8b29a33879305abb31a7913d
Reviewed-on: https://go-review.googlesource.com/c/go/+/182957
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agocmd/go/internal/modfetch: re-resolve commit hashes in readDiskStat
Bryan C. Mills [Wed, 12 Jun 2019 22:07:32 +0000 (18:07 -0400)]
cmd/go/internal/modfetch: re-resolve commit hashes in readDiskStat

Previously, when we resolved a commit hash (not a complete version),
we always checked the contents of the module cache for any
pseudo-version matching that commit.

However, there are many possible names for a given commit. Generally
the semantically-highest valid name is the best, and that may change
over time as new tags are added, so if we are able to fetch a better
name from upstream we should do so. Otherwise, we should fall back to
the highest appropriate name found in the cache.

Fixes #27171
Updates #27173

Change-Id: Ib5c7d99eb463af84674e969813039cbbee7e395b
Reviewed-on: https://go-review.googlesource.com/c/go/+/182178
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: roger peppe <rogpeppe@gmail.com>
5 years agomath: add examples for Log, Log2, Mod, and Abs
Michael Brandenburg [Wed, 19 Jun 2019 05:16:05 +0000 (22:16 -0700)]
math: add examples for Log, Log2, Mod, and Abs

Change-Id: I5f57acd5e970b3fec5f33cfceee179235cbf739f
Reviewed-on: https://go-review.googlesource.com/c/go/+/182877
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agonet/http: fix Server.IdleTimeout and Server.ReadHeaderTimeout docs
Raghavendra Nagaraj [Tue, 18 Jun 2019 08:30:24 +0000 (08:30 +0000)]
net/http: fix Server.IdleTimeout and Server.ReadHeaderTimeout docs

CL 46434 changed the doc for Server.IdleTimeout to include
falling back to Server.ReadHeaderTimeout if both
Server.IdleTimeout and Server.ReadTimeout are zero.
However, we explicitly set the ReadDeadlines firstly based
off Server.IdleTimeout or Server.ReadTimeout before attempting
to read the next request, thus the current doc is incorrect.

This CL reverts CL 46434 and also updates the doc for
Server.ReadHeaderTimeout to documenting falling back
to Server.ReadTimeout, if the former is zero, otherwise
there is no timeout.

Fixes #32053

Change-Id: I43dd0252d1bcee6c29a8529abd84c84a49b2fba9
GitHub-Last-Rev: e1cdb599772476e0b52d9d2374c3ea3893844eb4
GitHub-Pull-Request: golang/go#32164
Reviewed-on: https://go-review.googlesource.com/c/go/+/178337
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
5 years agodoc/go1.13: add crypto-related release notes
Filippo Valsorda [Mon, 17 Jun 2019 22:28:27 +0000 (18:28 -0400)]
doc/go1.13: add crypto-related release notes

Change-Id: I05d4ff3d3a31f56c9ceebdaceb39535a1351b26a
Reviewed-on: https://go-review.googlesource.com/c/go/+/182701
Reviewed-by: Andrew Bonventre <andybons@golang.org>
5 years agocmd/go: fix sumdb test failure with misbehaving DNS server
Jay Conrod [Tue, 18 Jun 2019 19:31:18 +0000 (15:31 -0400)]
cmd/go: fix sumdb test failure with misbehaving DNS server

Broadened the regular expression used to test error messages for
failing to connect to "localhost.localdev/sumdb". Some DNS servers
resolve unknown domains like "localhost.localdev" to real IP addresses
to serve ads. We may get a variety of error messages.

Fixes #31779

Change-Id: Ib389c633c9a9f70f8e89bbcba5282a375da4e708
Reviewed-on: https://go-review.googlesource.com/c/go/+/182799
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agodoc/go1.13: add release notes for the net package
Andrew [Mon, 17 Jun 2019 20:20:53 +0000 (16:20 -0400)]
doc/go1.13: add release notes for the net package

Change-Id: I54dc8afc33d6f8946d2c79b0339118fa3710a688
Reviewed-on: https://go-review.googlesource.com/c/go/+/182618
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agodoc/go1.13: runtime release notes, some compiler release notes
Austin Clements [Fri, 14 Jun 2019 19:02:35 +0000 (15:02 -0400)]
doc/go1.13: runtime release notes, some compiler release notes

Change-Id: Icc5083a3de0c6b737bfc20b573ed785651910148
Reviewed-on: https://go-review.googlesource.com/c/go/+/182461
Reviewed-by: Andrew Bonventre <andybons@golang.org>
5 years agoreflect,doc: use "the" instead of "a" in IsZero docs
Josh Bleecher Snyder [Mon, 17 Jun 2019 19:57:40 +0000 (12:57 -0700)]
reflect,doc: use "the" instead of "a" in IsZero docs

There is a subtle distinction between a value
*being* the zero value vs being *equal to* the zero value.
This was discussed at length in #31450.

Using "a zero value" in the docs suggests that there may
be more than zero value. That is possible on the "equal to
zero value" reading, but not the "is zero" reading that we
selected for the semantics of IsZero.

This change attempts to prevent any confusion on this front by
switching to "the zero value" in the documentation.

And while we're here, eliminate a double-space.
(Darn macbook keyboards.)

Change-Id: Iaa02ba297438793f5a90be9919a4d53baef92f8e
Reviewed-on: https://go-review.googlesource.com/c/go/+/182617
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agodoc: remove a Google+ link since it doesn't exist anymore
Steve Mynott [Mon, 17 Jun 2019 21:05:23 +0000 (21:05 +0000)]
doc: remove a Google+ link since it doesn't exist anymore

Change-Id: I692229a5597a6114a7f4261f7b59c58bf20f3e2b
GitHub-Last-Rev: ab173354caa63345d38a625705aea0c660cfdb9b
GitHub-Pull-Request: golang/go#32660
Reviewed-on: https://go-review.googlesource.com/c/go/+/182677
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/go/internal/modload: query correct "latest" version through proxy
Jay Conrod [Mon, 17 Jun 2019 21:03:55 +0000 (17:03 -0400)]
cmd/go/internal/modload: query correct "latest" version through proxy

This fixes a regression introduced in CL 180337. When we query a
module at "latest" that has no tagged versions, we tried to use ""
as the version because we used info.Name instead of info.Version. This
only happened when using a proxy: in direct mode, info.Name is set to
the underlying VCS revision, which is fine.

Also: serve "/mod/path/@latest" through our test proxy.
Previously, we served a 404, which made this bug hard to detect.

Fixes #32636

Change-Id: I5c60975656297f862cad66675170e819685ebd39
Reviewed-on: https://go-review.googlesource.com/c/go/+/182697
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agohtml/template, text/template: document glob semantics
Andrew Gerrand [Fri, 31 May 2019 11:25:04 +0000 (21:25 +1000)]
html/template, text/template: document glob semantics

This change updates the doc comments of the various ParseGlob functions
and methods to state that they use the semantics of filepath.Match when
matching the file name pattern.

Fixes #30608

Change-Id: Iee4bdc0a2a2f8647d1f9a910e4d72a5de9204d11
Reviewed-on: https://go-review.googlesource.com/c/go/+/179739
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
5 years agodoc: update 1.13 release notes
Keith Randall [Mon, 10 Jun 2019 19:51:51 +0000 (12:51 -0700)]
doc: update 1.13 release notes

Write release notes for a few reflect, runtime, and syscall changes.

The init randomization has been reverted.

Change-Id: Idae481ca015e325eb7302abaa15b2792312f4c32
Reviewed-on: https://go-review.googlesource.com/c/go/+/181577
Reviewed-by: Austin Clements <austin@google.com>