]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
5 years ago[release-branch.go1.11] go1.11rc2 go1.11rc2
Andrew Bonventre [Wed, 22 Aug 2018 22:04:16 +0000 (18:04 -0400)]
[release-branch.go1.11] go1.11rc2

Change-Id: Ib303cf7c8965d1d004f4c9e4935f9d4d54c5ee37
Reviewed-on: https://go-review.googlesource.com/130935
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years ago[release-branch.go1.11] internal/poll, net: fix sendfile on Windows, add test
Brad Fitzpatrick [Wed, 22 Aug 2018 20:31:37 +0000 (20:31 +0000)]
[release-branch.go1.11] internal/poll, net: fix sendfile on Windows, add test

Fixes #27085

Change-Id: I4eb3ff7c76e0b8e4d8fe0298f739b0284d74a031
Reviewed-on: https://go-review.googlesource.com/130895
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years ago[release-branch.go1.11] crypto/tls: make ConnectionState.ExportKeyingMaterial a method
Filippo Valsorda [Tue, 21 Aug 2018 20:50:04 +0000 (14:50 -0600)]
[release-branch.go1.11] crypto/tls: make ConnectionState.ExportKeyingMaterial a method

The unexported field is hidden from reflect based marshalers, which
would break otherwise. Also, make it return an error, as there are
multiple reasons it might fail.

Fixes #27131

Change-Id: I92adade2fe456103d2d5c0315629ca0256953764
Reviewed-on: https://go-review.googlesource.com/130535
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 240cb4c75fbe969364edb1a7f7ebd2d827831d34)
Reviewed-on: https://go-review.googlesource.com/130655

5 years ago[release-branch.go1.11] cmd/go: fix list -compiled of package with only tests
Russ Cox [Tue, 21 Aug 2018 01:35:02 +0000 (21:35 -0400)]
[release-branch.go1.11] cmd/go: fix list -compiled of package with only tests

Fixes #27097.

Change-Id: I6aa48a1c58a21fd320b0e9dcd1f86c90172f0182
Reviewed-on: https://go-review.googlesource.com/130139
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
(cherry picked from commit df6aedb630b3c79ff50147a85278a17702dcff1f)
Reviewed-on: https://go-review.googlesource.com/130617
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years ago[release-branch.go1.11] cmd/go: fix 'go help go.mod' example
Russ Cox [Tue, 21 Aug 2018 01:42:02 +0000 (21:42 -0400)]
[release-branch.go1.11] cmd/go: fix 'go help go.mod' example

Dropped the example referred to in the text
when copying this text out of 'go help mod fix'.

Fixes #27083.

Change-Id: I63dfa3033fa2b2408019eef9d8b5a055aa803c57
Reviewed-on: https://go-review.googlesource.com/130140
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
(cherry picked from commit 27ed675b4bbb63b5b5d84a21be583ef6147a2084)
Reviewed-on: https://go-review.googlesource.com/130618
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
5 years ago[release-branch.go1.11] cmd/go: add go.sum entries to go mod download -json output
Russ Cox [Sat, 18 Aug 2018 18:16:26 +0000 (14:16 -0400)]
[release-branch.go1.11] cmd/go: add go.sum entries to go mod download -json output

Clients of 'go mod download', particularly proxies, may need
the hashes of the content they downloaded, for checking against
go.sum entries or recording elsewhere.

Change-Id: Ic36c882cefc540678e1bc5a3dae1e865d181aa69
Reviewed-on: https://go-review.googlesource.com/129802
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
(cherry picked from commit 46033d7639cb1399029b99bb0cdc53d2b8f4bd08)
Reviewed-on: https://go-review.googlesource.com/130615
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years ago[release-branch.go1.11] cmd/go: fix modload response for std-vendored packages
Russ Cox [Tue, 21 Aug 2018 01:25:01 +0000 (21:25 -0400)]
[release-branch.go1.11] cmd/go: fix modload response for std-vendored packages

This fixes a failure when using Go 1.11 to build App Engine code.

Change-Id: I008e8cf5ad4c568676d904deddff031a166f2d5d
Reviewed-on: https://go-review.googlesource.com/130138
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
(cherry picked from commit c652a1b9c041a2d359665f01de21b19d53ba5ce5)
Reviewed-on: https://go-review.googlesource.com/130616
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
5 years ago[release-branch.go1.11] cmd/go: fix modload infinite directory loop
Daniel Martí [Sun, 19 Aug 2018 12:53:57 +0000 (13:53 +0100)]
[release-branch.go1.11] cmd/go: fix modload infinite directory loop

It is possible to enter the parent-walking directory loop in a way that
it will loop forever - if mdir is empty, and d reaches ".". To avoid
this, make sure that the 'd = filepath.Dir(d)' step only happens if the
parent directory is actually different than the current directory.

This fixes some of the tests like TestImport/golang.org_x_net_context,
which were never finishing before.

While at it, also fix TestImport/golang.org_x_net, which seems to have
the wrong expected error. The root of the x/net repo doesn't have a
go.mod file, nor is part of a module itself, so it seems like the
expected error should reflect that.

After these two changes, 'go test cmd/go/internal/modload' passes on my
linux/amd64 machine.

Fixes #27080.

Change-Id: Ie8bab0f9fbc9f447844cbbc64117420d9087db1b
Reviewed-on: https://go-review.googlesource.com/129778
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 692307aa839252285ebb91b4072e3c05ff554341)
Reviewed-on: https://go-review.googlesource.com/130275
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
5 years ago[release-branch.go1.11] Merge branch 'master' into release-branch.go1.11
Brad Fitzpatrick [Mon, 20 Aug 2018 04:32:00 +0000 (04:32 +0000)]
[release-branch.go1.11] Merge branch 'master' into release-branch.go1.11

Change-Id: I4f09f847c7304e37df8388b45aa8d6281a677de3

5 years agocmd/go: add missing newlines in printf formats
Daniel Martí [Sun, 19 Aug 2018 14:58:35 +0000 (15:58 +0100)]
cmd/go: add missing newlines in printf formats

These are all errors given by module-aware cmd/go, so they must end with
a newline. It looks like they were omitted by mistake.

Fixes #27081.

Change-Id: I19b5803bb48a6d5dd52e857f483278fe20fe246b
Reviewed-on: https://go-review.googlesource.com/129780
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agodoc/go1.11: Delve 1.1.0 added support for method calls
Austin Clements [Sat, 18 Aug 2018 18:50:50 +0000 (14:50 -0400)]
doc/go1.11: Delve 1.1.0 added support for method calls

Change-Id: I5f887f9831378cf76f5a9f447f481ea24c63f390
Reviewed-on: https://go-review.googlesource.com/129803
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/go: fix module get -insecure
Russ Cox [Sat, 18 Aug 2018 04:42:58 +0000 (00:42 -0400)]
cmd/go: fix module get -insecure

Need to actually use the flag for it to take effect.

Fixes #27049.

Change-Id: I57227b45f46f9dd67ecbf87c11bb2d08124bcfa0
Reviewed-on: https://go-review.googlesource.com/129801
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/go/internal/modconv: fix TestConvertLegacyConfig expectations
Russ Cox [Sat, 18 Aug 2018 04:41:52 +0000 (00:41 -0400)]
cmd/go/internal/modconv: fix TestConvertLegacyConfig expectations

It was a bug to find that commit in the Masterminds/semver repo.
It's not part of the main repo but only part of an unmerged pull request.
The code was updated to try not to look at unmerged pull requests,
but the test was not. Worse, whether the code succeeds at not looking
at unmerged pull requests apparently depends on the git version.
Sigh.

Fixes #26754.
Fixes #27043.

Change-Id: Ib9e07f565906de4f1169244911a258396688f14d
Reviewed-on: https://go-review.googlesource.com/129800
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/go: fix go mod tidy crash on empty module
Russ Cox [Sat, 18 Aug 2018 03:08:24 +0000 (23:08 -0400)]
cmd/go: fix go mod tidy crash on empty module

Fixes #27066.

Change-Id: Iede4385ad86b42d7d90814965b161a7e64d29833
Reviewed-on: https://go-review.googlesource.com/129799
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/go: allow 'go run x.go' to use nearby internal imports in module mode
Russ Cox [Sat, 18 Aug 2018 02:32:22 +0000 (22:32 -0400)]
cmd/go: allow 'go run x.go' to use nearby internal imports in module mode

In GOPATH mode the rule has always been that 'go run x.go' can
import whatever the package in x.go's directory would be able to
import. Apply the same rule here.

The bad import path was triggering other mysterious errors
during 'go run' in other circumstances. Setting it correctly fixes
those too.

Fixes #26046.
Fixes #27022.

Change-Id: I0a9b0a154a20f48add5a199da85572e7ffe0cde4
Reviewed-on: https://go-review.googlesource.com/129798
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/go: fix and reenable TestAccidentalGitCheckout
Russ Cox [Sat, 18 Aug 2018 01:25:52 +0000 (21:25 -0400)]
cmd/go: fix and reenable TestAccidentalGitCheckout

This is an important security problem so we shouldn't disable the test.
The second half was failing on case-sensitive file systems but the
first half is still good.

Fixes #22983.

Change-Id: I437bb4c9f78eb3177aa8b619e2357b2539566ca9
Reviewed-on: https://go-review.googlesource.com/129797
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/go: update TestGoGetUpdateWithWildcard expected behavior
Russ Cox [Sat, 18 Aug 2018 01:10:19 +0000 (21:10 -0400)]
cmd/go: update TestGoGetUpdateWithWildcard expected behavior

If you run

go get -u github.com/rsc/foo/bar...

then the go get command has always worked hard to make sure
that it applies the wildcard after downloading rsc/foo.
(If it applied the wildcard only before downloading rsc/foo,
it would match nothing if you had an empty GOPATH before,
and you'd still have an empty afterward, which is clearly useless.)

The goal has always been that if you run the same go get
command twice, the second command doesn't find anything
new to do.

CL 19892 worked around an "internal error" failure but broke
the rule about the first command doing everything the second
command would. Suppose you had github.com/rsc/foo already,
with just github.com/rsc/foo/bar, and you run

go get -u github.com/rsc/...

The wildcard first matches github.com/rsc/foo/bar, but suppose
updating the repo pulls down github.com/rsc/foo/baz, which
in turn depends on the non-existent package github.com/rsc/quux.
We need to reevaluate the wildcard after the download.

The new pattern match refactoring makes this easier and happened
to have corrected the behavior, but we missed a long test that
expected the old behavior.

Fix that long test.

Change-Id: I088473e7a90925e5c0f9697da9554a11456ddd08
Reviewed-on: https://go-review.googlesource.com/129796
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agocmd/go: treat VCS errors as hard errors in module search
Russ Cox [Fri, 17 Aug 2018 19:40:55 +0000 (15:40 -0400)]
cmd/go: treat VCS errors as hard errors in module search

If we're looking for a module for a/b/c/d/e,
we check for a module named a/b/c/d/e,
then a/b/c/d, then a/b/c, then a/b, then a.
If we know the source repo for a/b/c and that
fails, we should report that error instead of
continuing the loop: a/b and a are useless,
and the error from a/b/c contains important
information.

The errors are now a bit more verbose than
I'd like but they will suffice for Go 1.11.

$ go get github.com/bradfitz/private/sonos
go get github.com/bradfitz/private/sonos: git ls-remote -q origin in /Users/rsc/pkg/mod/cache/vcs/61e3c76780847e514802ec6af8f940f641c6017f711444f05c59cb17ac46d456: exit status 128:
remote: Repository not found.
fatal: repository 'https://github.com/bradfitz/private/' not found
$ go list launchpad.net/gocheck
can't load package: package launchpad.net/gocheck: unknown import path "launchpad.net/gocheck": bzr branch --use-existing-dir https://launchpad.net/~niemeyer/gocheck/trunk . in /Users/rsc/pkg/mod/cache/vcs/f46ce2ae80d31f9b0a29099baa203e3b6d269dace4e5357a2cf74bd109e13339: exec: "bzr": executable file not found in $PATH
$

Fixes #26885.
Fixes #26982.

Change-Id: I2f9cf1853d2d68af18adad668c80513b6ba220d6
Reviewed-on: https://go-review.googlesource.com/129683
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/go: remove go mod fix, add go help go.mod
Russ Cox [Fri, 17 Aug 2018 18:47:31 +0000 (14:47 -0400)]
cmd/go: remove go mod fix, add go help go.mod

"go mod fix" does work already done by nearly every other go command.
It was also confusing why we had both "go mod fix" and "go mod tidy".
Delete "go mod fix".

The main reason we kept "go mod fix" this long was for the discussion
of automatic go.mod updates in its documentation, which is now moved
into a new "go help go.mod".

Fixes #26831.

Change-Id: Ic95ca8918449ab79791d27998e02eb3377ac7972
Reviewed-on: https://go-review.googlesource.com/129682
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/go/internal/modfetch: correct TestCodeRepo expectation
Russ Cox [Fri, 17 Aug 2018 19:53:35 +0000 (15:53 -0400)]
cmd/go/internal/modfetch: correct TestCodeRepo expectation

The proxy protocol was simplified to only send
(and only receive) the Path and Version fields
in the JSON blob, not Name and Short.
(Those make sense when querying a VCS repo directly,
but not when talking about extracted modules.)
So don't expect them in the test.

Fixes #27042.

Change-Id: I3daacd668126e2227dcc8e6b89ee0cf0e3c8497c
Reviewed-on: https://go-review.googlesource.com/129684
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agoos: handle TMPDIR in TempDir on Plan 9
David du Colombier [Fri, 17 Aug 2018 22:05:46 +0000 (00:05 +0200)]
os: handle TMPDIR in TempDir on Plan 9

CL 129063 added a test in TestScript/mod_enabled,
which was failing on Plan 9.

The test was failing because the Init function
of the cmd/go/internal/modload package was
expecting ModRoot to be part of os.TempDir.

However, ModRoot was set to TMPDIR, while
os.TempDir is returning /tmp on Plan 9.

This change fixes the implementation of
os.TempDir on Plan 9 to handle the TMPDIR
environment variable, similarly to Unix.

Fixes #27065.

Change-Id: Id6ff926c5c379f63cab2dfc378fa6c15293fd453
Reviewed-on: https://go-review.googlesource.com/129775
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/go: do not turn list ./nonexist into a network lookup
Russ Cox [Fri, 10 Aug 2018 20:28:48 +0000 (16:28 -0400)]
cmd/go: do not turn list ./nonexist into a network lookup

If you're in a directory corresponding to x/y
and you run go list ./z, we do at some point
want to turn that into x/y/z. But if ./z does
not exist that will make the go command
check the network to see if it can find x/y/z.
That's clearly wrong: ./z means that directory,
nothing else. And it turns a typo into a long delay,
which is even worse.

Fixes #26874.

Change-Id: Iec15fa7b359af11b6a4fc6cb082e593658fb6e41
Reviewed-on: https://go-review.googlesource.com/129061
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
5 years agocmd/go: report which patterns match each package in list
Russ Cox [Fri, 17 Aug 2018 16:40:18 +0000 (12:40 -0400)]
cmd/go: report which patterns match each package in list

It's important for some uses of go/packages, as well as for some
of go/packages's internal use, to be able to tell which results from
go list output correspond to which patterns, keeping in mind that
a single package might have been matched by multiple patterns.

Also adds test for #26925.

Change-Id: I708ac162f65d9946fe6afb244b08dc7b04d2b530
Reviewed-on: https://go-review.googlesource.com/129060
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
5 years agocmd/go: fix -gcflags, -ldflags not applying to current directory
Russ Cox [Fri, 10 Aug 2018 04:01:48 +0000 (00:01 -0400)]
cmd/go: fix -gcflags, -ldflags not applying to current directory

A flag setting like -gcflags=-e applies only to the packages
named on the command line, not to their dependencies.
The way we used to implement this was to remember the
command line arguments, reinterpret them as pattern matches
instead of package argument generators (globs), and apply them
during package load. The reason for this complexity was to
address a command-line like:

go build -gcflags=-e fmt runtime

The load of fmt will load dependencies, including runtime,
and the load of runtime will reuse the result of the earlier load.
Because we were computing the effective -gcflags for each
package during the load, we had to have a way to tell, when
encountering runtime during the load of fmt, that runtime had
been named on the command line, even though we hadn't
gotten that far. That would be easy if the only possible
arguments were import paths, but we also need to handle

go build -gcflags=-e fmt runt...
go build -gcflags=-e fmt $GOROOT/src/runtime
go build -gcflags=-e fmt $GOROOT/src/runt...
and so on.

The match predicates usually did their job well, but not
always. In particular, thanks to symlinks and case-insensitive
file systems and unusual ways to spell file paths, it's always
been possible in various corner cases to give an argument
that evalutes to the runtime package during loading but
failed to match it when reused to determine "was this package
named on the command line?"

CL 109235 fixed one instance of this problem by making
a directory pattern match case-insensitive on Windows, but that
is incorrect in some other cases and doesn't address the root problem,
namely that there will probably always be odd corner cases
where pattern matching and pattern globbing are not exactly aligned.

This CL eliminates the assumption that pattern matching
and pattern globbing are always completely in agreement,
by simply marking the packages named on the command line
after the package load returns them. This means delaying
the computation of tool flags until after the load too,
for a few different ways packages are loaded.
The different load entry points add some complexity,
which is why the original approach seemed more attractive,
but the original approach had complexity that we simply
didn't recognize at the time.

This CL then rolls back the CL 109235 pattern-matching change,
but it keeps the test introduced in that CL. That test still passes.

In addition to fixing ambiguity due to case-sensitive file systems,
this new approach also very likely fixes various ambiguities that
might arise from abuse of symbolic links.

Fixes #24232.
Fixes #24456.
Fixes #24750.
Fixes #25046.
Fixes #25878.

Change-Id: I0b09825785dfb5112fb11494cff8527ebf57966f
Reviewed-on: https://go-review.googlesource.com/129059
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
5 years agocmd/go: distinguish patterns from the results of matching them
Russ Cox [Fri, 10 Aug 2018 17:26:32 +0000 (13:26 -0400)]
cmd/go: distinguish patterns from the results of matching them

To date the go command has always just treated the command line
package patterns as a []string, expanded by pattern matching into
another []string. As a result, the code is not always clear about
whether a particular []string contains patterns or results.
A few different important bugs are caused by not keeping
this distinction clear enough. This CL sets us up well for fixing those,
by introducing an explicit search.Match struct holding the
results of matching a single pattern.

The added clarity here also makes it clear how to avoid duplicate
warnings about unmatched packages.

Fixes #26925. (Test in followup CL.)

Change-Id: Ic2f0606f7ab8b3734a40e22d3cb1e6f58d031061
Reviewed-on: https://go-review.googlesource.com/129058
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
5 years agodoc: describe golang.org/x/go/packages in go1.11 release notes
Alan Donovan [Thu, 16 Aug 2018 20:31:45 +0000 (16:31 -0400)]
doc: describe golang.org/x/go/packages in go1.11 release notes

Also, rename an HTML element ID to avoid duplicate.

Fixes golang/go#27038

Change-Id: Icc064a1cc86ddc794fc085d98b4cde3effff8ad0
Reviewed-on: https://go-review.googlesource.com/129635
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
5 years agogo/doc: allow interior dot in heading, as in "go.mod"
Russ Cox [Fri, 17 Aug 2018 14:51:53 +0000 (10:51 -0400)]
go/doc: allow interior dot in heading, as in "go.mod"

Only the expected headings are affected.
Diffing the output of "go run headscan.go" before and after:

$ diff head1 head2
26a27,28
>  Edit go.mod from tools or scripts
>  Make go.mod semantically consistent
168c170
< 141 headings found
---
> 143 headings found
$

Fixes #26938.

Change-Id: I204fd982a60773aa26880cd19eed890c373b8ab6
Reviewed-on: https://go-review.googlesource.com/129677
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agodoc/code: drop mentions of GOPATH/pkg directory
Russ Cox [Fri, 17 Aug 2018 15:07:30 +0000 (11:07 -0400)]
doc/code: drop mentions of GOPATH/pkg directory

It's already half gone and later will be all gone.
It's not worth explaining in an introduction doc.

Fixes #24506
Updates #4719

Change-Id: Ie48128b3aa090d84e0e734aa45f14a4480292913
Reviewed-on: https://go-review.googlesource.com/129679
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/vet: don't suggest ... if it breaks a program
Daniel Martí [Thu, 16 Aug 2018 13:39:13 +0000 (14:39 +0100)]
cmd/vet: don't suggest ... if it breaks a program

It is possible to write a function that seems to wrap a print/printf
call, but then doesn't. For example, if the string parameter we thought
was the format is used as another argument.

One option would be to make vet's print analysis smarter, to detect when
format strings are indeed used like we initially suspected.

However, I've opted for a simpler solution - check if the print/printf
call is already using more than one variadic argument, in which case
using an ellipsis in the last one would break the program:

// too many arguments in call to fmt.Printf
fmt.Printf(format, arg0, args...)

Fixes #26979.

Change-Id: I39371f1cec8483cfd2770a91670c1e80cbb9efdf
Reviewed-on: https://go-review.googlesource.com/129575
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
5 years agocmd/compile: make duplicate anonymous interface output deterministic
Dan Johnson [Wed, 15 Aug 2018 23:48:44 +0000 (16:48 -0700)]
cmd/compile: make duplicate anonymous interface output deterministic

Ranging through a map is non-deterministic and there can be duplicate
entries in the set (with the same name) which don't have identical
definitions in some cases.

Fixes #27013

Change-Id: I378c48bc359c10b25b9238e0c663b498455b19fd
Reviewed-on: https://go-review.googlesource.com/129515
Reviewed-by: Russ Cox <rsc@golang.org>
5 years agocmd/go: document import "C" check from CL 129062
Russ Cox [Fri, 17 Aug 2018 14:54:20 +0000 (10:54 -0400)]
cmd/go: document import "C" check from CL 129062

Added this locally but then broke the first rule of Gerrit
and clicked Submit instead of running "git submit".

Change-Id: I83c28d9151c566e9b2092e2613d67731a5d64beb
Reviewed-on: https://go-review.googlesource.com/129678
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
5 years agocmd/go: ignore import "C" files in module loader in non-cgo mode
Russ Cox [Sat, 11 Aug 2018 00:05:44 +0000 (20:05 -0400)]
cmd/go: ignore import "C" files in module loader in non-cgo mode

Obviously, including files that import "C" when cgo is disabled is wrong.
The package load step correctly excludes them and finds no files at all,
which then causes a failure.

Fixes #26927.

Change-Id: I00e6d6450e783d467d20bde99e91240ecb0db837
Reviewed-on: https://go-review.googlesource.com/129062
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: David du Colombier <0intro@gmail.com>
5 years agocmd/go: ignore /tmp/go.mod
Russ Cox [Sat, 11 Aug 2018 00:22:21 +0000 (20:22 -0400)]
cmd/go: ignore /tmp/go.mod

Two different people have created /tmp/go.mod for experimentation
and then had other tests that create fresh work directories
below /tmp fail unexpectedly because the go command finds
/tmp/go.mod. Refuse to use /tmp/go.mod. /tmp/anything/go.mod is fine.

Fixes #26708.

Change-Id: I2a4f61ea63099cff59fbf9e8798e5dcefefd5557
Reviewed-on: https://go-review.googlesource.com/129063
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/go: disable TestAccidentalGitCheckout for now
Brad Fitzpatrick [Thu, 16 Aug 2018 16:54:11 +0000 (09:54 -0700)]
cmd/go: disable TestAccidentalGitCheckout for now

It seems it might not have ever worked.

Updates #22983

Change-Id: Icc022539aa2555486a65900abf97dfa30f92a1ea
Reviewed-on: https://go-review.googlesource.com/129615
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
5 years agoruntime: load errno as signed 32-bit
Keith Randall [Wed, 15 Aug 2018 23:21:00 +0000 (16:21 -0700)]
runtime: load errno as signed 32-bit

the function libc_errno returns a pointer to a signed-32 bit quantity,
not a 64-bit quantity.

Fixes #27004

Change-Id: I0623835ee34fd9655532251f096022a5accb58cd
Reviewed-on: https://go-review.googlesource.com/129475
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/go: fix typos in go help mod subpages
Alberto Donizetti [Thu, 16 Aug 2018 14:55:32 +0000 (16:55 +0200)]
cmd/go: fix typos in go help mod subpages

mkalldocs.sh was run and it also picked up a doc change introduced in
CL 128935, where it wasn't run.

Fixes #27030

Change-Id: Ie13fdb71cd7d5481366a02eb711ca48f094026fd
Reviewed-on: https://go-review.googlesource.com/129576
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agogo/printer: consider empty lines in table layout computation
Robert Griesemer [Tue, 14 Aug 2018 00:57:39 +0000 (17:57 -0700)]
go/printer: consider empty lines in table layout computation

In previous versions of Go including 1.10, an empty line would break the
alignment of elements within an expression list.

golang.org/cl/104755 changed the heuristic, with the side effect that
empty lines no longer broke the table alignment.

A prior fix (https://go-review.googlesource.com/c/go/+/125260, reverted)
introduced another regression (#26930) which this change doesn't produce.

Added test cases for both #26352 and #26930.

Fixes #26352.
Updates #26930.

Change-Id: I371f48e6f3620ebbab53f2128ec5e58bcd4a62f1
Reviewed-on: https://go-review.googlesource.com/129256
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Alan Donovan <adonovan@google.com>
5 years agoruntime: go fmt runtime2.go
Martin Möhrmann [Sat, 28 Jul 2018 14:46:22 +0000 (16:46 +0200)]
runtime: go fmt runtime2.go

Change-Id: I29a6125c9ef285fc365c4e11ab158b79224ae333
Reviewed-on: https://go-review.googlesource.com/126602
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agogo/printer: revert "make empty lines break table alignment"
Robert Griesemer [Tue, 14 Aug 2018 00:25:49 +0000 (17:25 -0700)]
go/printer: revert "make empty lines break table alignment"

This reverts commit c116265eb3f2b1a8549e7ceef73b780439404030.

The change, while addressing issue #26352, introduced another
regression (#26930), which is worse. Reverting this change in
favor of a better fix for the original issue.

Updates #26352.
Fixes #26930.

Change-Id: I71ad12a8212992cce5c1e73907d1f7460f98d9e8
Reviewed-on: https://go-review.googlesource.com/129255
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/compile/internal/gc: add nil check for closure call on wasm
Richard Musiol [Sun, 5 Aug 2018 16:52:15 +0000 (18:52 +0200)]
cmd/compile/internal/gc: add nil check for closure call on wasm

This commit adds an explicit nil check for closure calls on wasm,
so calling a nil func causes a proper panic instead of crashing on the
WebAssembly level.

Change-Id: I6246844f316677976cdd420618be5664444c25ae
Reviewed-on: https://go-review.googlesource.com/127759
Run-TryBot: Richard Musiol <neelance@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
5 years ago[release-branch.go1.11] go1.11rc1 go1.11rc1
Filippo Valsorda [Mon, 13 Aug 2018 22:08:35 +0000 (18:08 -0400)]
[release-branch.go1.11] go1.11rc1

Change-Id: I3bb2ad8f9f7283d76aa7d8999aa08c9f740c7b5d
Reviewed-on: https://go-review.googlesource.com/129236
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agonet/http: support configuring fetch options
Johan Brandhorst [Fri, 3 Aug 2018 14:48:16 +0000 (14:48 +0000)]
net/http: support configuring fetch options

The default WASM RoundTripper is implemented using
the browser Fetch API. Some options don't readily map to
existing http.Request options, so we use the precedent
set by the TrailerPrefix constant to allow a user to configure
the "mode" and "credentials" options by supplying them
as headers in the http.Request.

Updates #26769

Change-Id: If42d24418c4ffb17211f57e36708cf460fb4c579
GitHub-Last-Rev: b230502084d628938cd50818d3d336f9f911d48d
GitHub-Pull-Request: golang/go#26784
Reviewed-on: https://go-review.googlesource.com/127718
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agonet/http: update request cancelation docs
Brad Fitzpatrick [Mon, 13 Aug 2018 16:00:34 +0000 (16:00 +0000)]
net/http: update request cancelation docs

Fixes #26101

Change-Id: Id4def032b846257d2de992b7561ac90a17e08b91
Reviewed-on: https://go-review.googlesource.com/129155
Reviewed-by: Andrew Bonventre <andybons@golang.org>
5 years agodoc: update the primary security coordinator to filippo@
Filippo Valsorda [Sun, 12 Aug 2018 20:00:58 +0000 (16:00 -0400)]
doc: update the primary security coordinator to filippo@

Fixes #26876

Change-Id: Ibef4e305bead1432c6a02bc2507f8000c2f4b892
Reviewed-on: https://go-review.googlesource.com/129064
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agoA+C: second and final round of updates for Go 1.11
Filippo Valsorda [Thu, 9 Aug 2018 20:10:41 +0000 (16:10 -0400)]
A+C: second and final round of updates for Go 1.11

Updates #12042

Change-Id: Ia8d2214caad50560c4d46d723f8b94c954059b98
Reviewed-on: https://go-review.googlesource.com/128877
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/go: don't let ... match GOROOT/src/cmd in module mode
Russ Cox [Fri, 10 Aug 2018 19:25:15 +0000 (15:25 -0400)]
cmd/go: don't let ... match GOROOT/src/cmd in module mode

GOROOT/src/cmd uses GOROOT/src/cmd/vendor, which module
mode simply cannot handle.

Exposed by making ... match the standard library, which it still should.

But for now it's fine to just exclude commands.

Change-Id: I2201b94445f11239022de8a2473aa3b573f405c0
Reviewed-on: https://go-review.googlesource.com/129055
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agocmd/go: report implicit cgo inputs in go list -compiled
Russ Cox [Fri, 10 Aug 2018 03:44:43 +0000 (23:44 -0400)]
cmd/go: report implicit cgo inputs in go list -compiled

Tools using go list -compiled expect to see an Imports list
that includes all the imports in CompiledGoFiles.
Make sure the list includes the cgo-generated imports.

Fixes #26136.

Change-Id: I6cfe14063f8edfe65a7af37522c7551272115b82
Reviewed-on: https://go-review.googlesource.com/128935
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agocmd/go: fix module ... pattern to match standard library
Russ Cox [Fri, 10 Aug 2018 16:49:54 +0000 (12:49 -0400)]
cmd/go: fix module ... pattern to match standard library

The non-module ... pattern always has.

Fixes #26905.

Change-Id: I7b298747fb33b82c58d3e6a6bc6687b6e825e52c
Reviewed-on: https://go-review.googlesource.com/128997
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agocmd/go: do not try to understand git fetch --depth=1 errors
Russ Cox [Fri, 10 Aug 2018 03:17:45 +0000 (23:17 -0400)]
cmd/go: do not try to understand git fetch --depth=1 errors

We used to try a git fetch --depth=1 of a specific hash and
distinguish between an error meaning
"that's not a hash I can give you directly"
(in which case we fall through and pull the whole repo)
and some other error like connection failure, bad ssh key
(in which case we give up).

We've had repeated problems trying to understand the
error meanings so just stop doing that, and fall back to
trying a full fetch on any error at all. If the error really
was some kind of network or auth or i/o problem, then
it will happen the second time and we can report it then.

Fixes #26894.

Change-Id: If1eaaddb87e8bfeff7a3894cce4ecef39802198c
Reviewed-on: https://go-review.googlesource.com/128904
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agocmd/go: display cached compiler output more often
Russ Cox [Fri, 10 Aug 2018 01:08:24 +0000 (21:08 -0400)]
cmd/go: display cached compiler output more often

CL 77110 arranged for caching and redisplaying compiler output
when reusing a compile artifact from the build cache.

It neglected to redisplay compiler and linker output when avoiding
the compile and link steps by reusing the target output binary
as a cached result. It also neglected to redisplay compiler and linker
output when avoiding the compile and link (and test) steps by reusing
cached test output.

This CL brings back the compiler and linker output in those two cases,
provided it can be found in the build cache. If it can't be found in the
build cache, then the go command still reuses the binaries and avoids
the compile/link/test steps. (It's not worth doing all that work again
just to repeat diagnostic output.)

Fixes #23877.

Change-Id: I25bc054d93a88c039bcb8c5683fe4ac5cb1ee544
Reviewed-on: https://go-review.googlesource.com/128903
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agocmd/go: fix spelling in proxy documentation
Tobias Klauser [Fri, 10 Aug 2018 06:51:54 +0000 (08:51 +0200)]
cmd/go: fix spelling in proxy documentation

After running mkalldocs.sh this also adds some previously missing parts
to alldocs.go

Change-Id: Ifa624c54543fd31d699a0d4bb5df7b1969bf941c
Reviewed-on: https://go-review.googlesource.com/128915
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agocmd/go: fix handling of gopkg.in/macaroon-bakery.v2-unstable
Russ Cox [Thu, 9 Aug 2018 21:03:05 +0000 (17:03 -0400)]
cmd/go: fix handling of gopkg.in/macaroon-bakery.v2-unstable

When we added v2.0.0+incompatible we generalized the API
enough to make it easy to also accepting these gopkg-specific
v2-unstable suffixes. Do that.

Fixes #23989.

Change-Id: Ieabed11a5250c2999d73450c10b20f4c645ad445
Reviewed-on: https://go-review.googlesource.com/128901
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agocmd/go: fix install target name for versioned binaries
Russ Cox [Thu, 9 Aug 2018 20:36:48 +0000 (16:36 -0400)]
cmd/go: fix install target name for versioned binaries

For a package in the module root, using the containing directory name
might mean the directory in the module cache, in which case the
executable has a final @v1.2.3 in it, which is no good. Fix that.

While we're here, change go install example.com/cmd/foo/v2 to
install foo instead of the less useful "v2".

Fixes #24667.
Fixes #26869.

Change-Id: Ie40ca1bc9e27955441f1cdb7abd3a1f69034c9f5
Reviewed-on: https://go-review.googlesource.com/128900
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agocmd/go: fix go.mod corruption using -mod=vendor
Russ Cox [Thu, 9 Aug 2018 20:16:43 +0000 (16:16 -0400)]
cmd/go: fix go.mod corruption using -mod=vendor

If we're using -mod=vendor then we effectively load
a fake build list from vendor/modules.txt.
Do not write it back to go.mod.

Fixes #26704.

Change-Id: Ie79f2103dc16d0b7fe0c884e77ba726c7e04f2e4
Reviewed-on: https://go-review.googlesource.com/128899
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agocmd/go: add go mod why
Russ Cox [Tue, 7 Aug 2018 19:52:04 +0000 (15:52 -0400)]
cmd/go: add go mod why

A very common question is
"why is this package or module being kept
by go mod vendor or go mod tidy?"

go mod why answers that question.

Fixes #26620.

Change-Id: Iac3b6bbdf703b4784f5eed8e0f69d41325bc6d7f
Reviewed-on: https://go-review.googlesource.com/128359
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agocmd/go: fix module loader and test-only dependencies
Russ Cox [Tue, 7 Aug 2018 19:50:24 +0000 (15:50 -0400)]
cmd/go: fix module loader and test-only dependencies

go list all was not behaving as documented - it did not pick up
test dependencies except when running in "go test" and "go vet".
It should pick them up always.

Also the module loader was ignoring tests when using "go list -test",
which led to load failures.

Fixing all required adjustments to mod_patterns test.
Removed error-prone exact listings.

Fixes #26279.
Fixes #26906.

Change-Id: I9c5acaf2275be20fd2349859589502190d3e7a78
Reviewed-on: https://go-review.googlesource.com/128358
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agocmd/go: make 'go list -test' report the correct import path
Suzy Mueller [Thu, 9 Aug 2018 17:05:54 +0000 (13:05 -0400)]
cmd/go: make 'go list -test' report the correct import path

When a test variant of a package is created, the two versions cannot
share memory for the fields that contain information about their
imports, as these will be different between the two packagse.

Both the Internal.Imports and the Imports fields must be able to be
updated in the test variant without affecting the values of the
original.

Fixes golang/go#26880

Change-Id: Id61fad7d976e179c6c7711a394ce43ec8302fd7a
Reviewed-on: https://go-review.googlesource.com/128836
Reviewed-by: Russ Cox <rsc@golang.org>
5 years agocmd/go: add go mod download
Russ Cox [Tue, 7 Aug 2018 16:01:36 +0000 (12:01 -0400)]
cmd/go: add go mod download

go mod download provides a way to force downloading
of a particular module version into the download cache
and also to locate its cached files.

Forcing downloads is useful for warming caches, such as
in base docker images.

Finding the cached files allows caching proxies to use
go mod download as the way to obtain module files
on cache miss.

Fixes #26577.
Fixes #26610.

Change-Id: Ib8065bcce07c9f5105868ec1d87887ef4871f07e
Reviewed-on: https://go-review.googlesource.com/128355
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agodoc/go1.11: add note about vet checks for printf wrappers
Andrew Bonventre [Thu, 9 Aug 2018 23:43:54 +0000 (19:43 -0400)]
doc/go1.11: add note about vet checks for printf wrappers

Fixes golang/go#26372

Change-Id: I30716ba56f829c6e36ccd50471e118084bad7360
Reviewed-on: https://go-review.googlesource.com/128902
Reviewed-by: Russ Cox <rsc@golang.org>
5 years agoruntime: fix TestGdbPythonCgo failure with ld.gold
Daniel Martí [Thu, 9 Aug 2018 16:25:13 +0000 (17:25 +0100)]
runtime: fix TestGdbPythonCgo failure with ld.gold

See the added comment for the reasoning behind the workaround.

Fixes #26868.

Change-Id: Idede020ec88a49595dc233d9a1346b12691186f4
Reviewed-on: https://go-review.googlesource.com/128815
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agocmd/compile: update delve's reference data for ssa/debug_test
David Chase [Wed, 18 Jul 2018 20:18:28 +0000 (16:18 -0400)]
cmd/compile: update delve's reference data for ssa/debug_test

Recent versions of Delve pay attention to the debugging changes
for 1.11, which causes different (better!) debugging behavior.
Update the reference data to reflect this.

Change-Id: I2efa165aa71769ace9f7885b4ce3420cd9b2d3a3
Reviewed-on: https://go-review.googlesource.com/128697
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agocmd/go: include experiments in compiler tool ID
Ian Lance Taylor [Wed, 8 Aug 2018 23:54:15 +0000 (16:54 -0700)]
cmd/go: include experiments in compiler tool ID

No test because testing this would require building a new toolchain
with a different experiment.

Fixes #26883

Change-Id: Iadd513d0920ef12463006dd2a61e94370dd13f68
Reviewed-on: https://go-review.googlesource.com/128735
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agocmd/go: skip TestScript/mod_patterns on nocgo builders
Bryan C. Mills [Thu, 9 Aug 2018 21:38:32 +0000 (17:38 -0400)]
cmd/go: skip TestScript/mod_patterns on nocgo builders

Updates #26906.

Change-Id: I61b08180aefe9cfc109a1009ca251ee6970eb2df
Reviewed-on: https://go-review.googlesource.com/128879
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agocmd/go/internal/modload: emit correct module in duplication error
Bryan C. Mills [Thu, 9 Aug 2018 20:14:27 +0000 (16:14 -0400)]
cmd/go/internal/modload: emit correct module in duplication error

Updates #26904.

Change-Id: If7f381c3f3a41bd62c5f8bcf4f92720badcaf5c6
Reviewed-on: https://go-review.googlesource.com/128878
Reviewed-by: Russ Cox <rsc@golang.org>
5 years agocmd/go: test package patterns with multiple modules
Bryan C. Mills [Wed, 8 Aug 2018 18:44:44 +0000 (14:44 -0400)]
cmd/go: test package patterns with multiple modules

This change replaces https://golang.org/cl/125835.

Updates #26317.

Change-Id: I38ae1f93e5f5c86737a4b489df498c18b179781d
Reviewed-on: https://go-review.googlesource.com/128637
Reviewed-by: Russ Cox <rsc@golang.org>
5 years agocmd/go/internal: factor out modload.QueryPackage and use in in modget
Bryan C. Mills [Mon, 6 Aug 2018 20:59:31 +0000 (16:59 -0400)]
cmd/go/internal: factor out modload.QueryPackage and use in in modget

modload.Import contains a loop that looks for the module containing a package.
Because we overload Import to locate both packages and modules, that loop
contains a bunch of special-cases for modules with empty roots.

In this change, we factor out the loop into a new function (QueryPackage) and
use that directly in modget.getQuery. That restores the invariant that
the paths passed to modload.Import must be importable packages, and fixes 'go
get' lookups for packages that have moved between a module and submodules with
the same path prefix.

Updates #26602.

Change-Id: I8bc8340c17f2df062d03ce720f4dc18b2ba406b2
Reviewed-on: https://go-review.googlesource.com/128136
Reviewed-by: Russ Cox <rsc@golang.org>
5 years agocmd/go/internal/modload: report errors explicitly from Lookup
Bryan C. Mills [Mon, 6 Aug 2018 21:25:10 +0000 (17:25 -0400)]
cmd/go/internal/modload: report errors explicitly from Lookup

Previously, we reported errors directly in (*loader).load via base.Errorf.
Unfortunately, (*loader).load can be called from contexts in which such errors
should not be considered fatal, such as by load.PackagesAndErrors.

Instead, we save the errors in pkg.err and modify Lookup to return that error.

This change is a bit awkward: we end up suppressing a "no Go files" error for
packages at the root of newly-imported modules, even if they really do contain
source files. I believe that that's due to a special-case lookup for modules in
the build list, which allows us to "validate" imports for modules in the build
list even though we haven't actually downloaded their sources (or verified that
they actually contain the requested package). The fix for that issue is in the
change that follows this one.

Fixes #26602.

Change-Id: I16f00ceb143fbb797cfc3cb07fd08aeb6154575b
Reviewed-on: https://go-review.googlesource.com/127936
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agogo/types: fix errors in recording type information
Rebecca Stambler [Thu, 9 Aug 2018 16:34:19 +0000 (12:34 -0400)]
go/types: fix errors in recording type information

In my previous change, I didn't use the correct functions for continuing
to record type informations after errors. Change to using the correct
functions, and add a comment to clarify in expr.go.

Updates #22467

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

5 years agocmd/go: test that 'go get pkg@version' installs pkg
Bryan C. Mills [Mon, 6 Aug 2018 22:06:06 +0000 (18:06 -0400)]
cmd/go: test that 'go get pkg@version' installs pkg

This test passes, but it encodes several behaviors that I think are bugs.
I suggest that we check it in as-is, and we can update it as the bugs are fixed.

Change-Id: Icb073de9cb13036dbccadb4ff2cb3169ffb56236
Reviewed-on: https://go-review.googlesource.com/128137
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
5 years agocmd/go: add test for 'go get' within a local module
Bryan C. Mills [Wed, 8 Aug 2018 14:38:19 +0000 (10:38 -0400)]
cmd/go: add test for 'go get' within a local module

Change-Id: I16d36c8e22c84a3266520d86e41ff71ef826ae70
Reviewed-on: https://go-review.googlesource.com/128555
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
5 years agocmd/go: add test cases for 'go list' with bad import paths
Bryan C. Mills [Mon, 6 Aug 2018 18:55:12 +0000 (14:55 -0400)]
cmd/go: add test cases for 'go list' with bad import paths

Change-Id: I45a675c5f699b23284a2a50b33cb22882f4b3b80
Reviewed-on: https://go-review.googlesource.com/128016
Reviewed-by: Russ Cox <rsc@golang.org>
5 years agocmd/go: fetch history as needed to resolve recent tags
Bryan C. Mills [Tue, 31 Jul 2018 22:32:25 +0000 (18:32 -0400)]
cmd/go: fetch history as needed to resolve recent tags

Fixes #26713.

Tested with Git 2.7.4. Older Gits may or may not work.

Change-Id: Ib72d751388dfbb50030191ae40f788d1402834b2
Reviewed-on: https://go-review.googlesource.com/126956
Reviewed-by: Russ Cox <rsc@golang.org>
5 years agogo/printer: make empty lines break table alignment
Daniel Martí [Fri, 20 Jul 2018 20:55:07 +0000 (21:55 +0100)]
go/printer: make empty lines break table alignment

In previous versions of Go including 1.10, an empty line would break the
alignment of elements within an expression list.

golang.org/cl/104755 changed the heuristic, with the side effect that
empty lines no longer broke the table alignment.

Reintroduce the behavior and add a regression test for it.

Fixes #26352.

Change-Id: I410bcff4cba25c7f8497d46bd7890a2c7ee11d46
Reviewed-on: https://go-review.googlesource.com/125260
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
5 years agoA+C: first round of automated updates for Go 1.11 and missing AUTHORS
Filippo Valsorda [Thu, 26 Jul 2018 21:18:39 +0000 (17:18 -0400)]
A+C: first round of automated updates for Go 1.11 and missing AUTHORS

One first round of low-hanging fruit, excluding anything unclear.

Also fixed a bug where, if a contributor had different emails under
different CLAs, only the first one was added to AUTHORS.

Updates #12042

Change-Id: Id7b06c885d74b4718ef2d74d149513a7c0f40c91
Reviewed-on: https://go-review.googlesource.com/126215
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agodoc.Example should not worry about unresolved blank identifiers
Mostyn Bramley-Moore [Wed, 8 Aug 2018 21:34:43 +0000 (21:34 +0000)]
doc.Example should not worry about unresolved blank identifiers

https://golang.org/pkg/bufio/#example_Scanner_custom is not directly
runnable in the playground via godoc, but if I copy+paste the code into
https://play.golang.org/ then it runs just fine.

This seems to be due to the blank identifier being considered unresolved
in the following line in the example:

_, err = strconv.ParseInt(string(token), 10, 32)

But that's the whole point of blank identifiers- they're not supposed
to be resolved.  So let's skip adding the blank identifier to
doc.playExample's unresolved map.

Fixes #26447

Change-Id: I52bc7d99be1d14a61dc012d10c18349d52ba4c51
GitHub-Last-Rev: 9172e9dc1378b0f37f96fc2e1ade4dda9d848398
GitHub-Pull-Request: golang/go#26448
Reviewed-on: https://go-review.googlesource.com/124775
Reviewed-by: Robert Griesemer <gri@golang.org>
5 years agodoc/contribute: add examples for finding issues on the issue tracker
Leigh McCulloch [Sat, 4 Aug 2018 06:40:45 +0000 (06:40 +0000)]
doc/contribute: add examples for finding issues on the issue tracker

For contributors looking for new issues to contribute to it can be
difficult to find issues that need a fix and don't already have a fix
being considered. There are several labels that help guide the way
already, like `NeedsFix`, `HelpWanted`. But many issues with this label
will already have a CL. For new contributors this can be especially
difficult.

Fixes #26494

Change-Id: Ifd38ea65e362b4c580207a06f959646e49ac594f
GitHub-Last-Rev: 6d2b54447b2ee754a6d025f5de3ebd8326e035eb
GitHub-Pull-Request: golang/go#26516
Reviewed-on: https://go-review.googlesource.com/125355
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agogo/types: if base type for an alias is known, use it when needed
Robert Griesemer [Wed, 8 Aug 2018 00:53:59 +0000 (17:53 -0700)]
go/types: if base type for an alias is known, use it when needed

Because methods are type-checked before the receiver base type
is "complete" (i.e., they are checked as part of the receiver
base type), situations occur where aliases of those base types
are used (in those methods) but the alias types are not known
yet (even though their base types are known).

This fix is a temporary work-around that looks syntactically
for the base types of alias types and uses those base types
when we refer to an "incomplete" alias type. The work-around
is completely localized and guarded with a flag so it can be
disabled at short notice.

The correct fix (slated for 1.12) is to decouple type-checking
of methods from their receiver base types. See issue #26854.

Fixes #26390.

Change-Id: I66cc9d834b220c254ac00e671a137cf8a3da59c1
Reviewed-on: https://go-review.googlesource.com/128435
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
5 years agoA+C: update Dmitri Shuralyov's emails
Dmitri Shuralyov [Wed, 8 Aug 2018 03:11:56 +0000 (23:11 -0400)]
A+C: update Dmitri Shuralyov's emails

Add my current personal email in both A+C, but keep old one too.
Add my @golang.org email to CONTRIBUTORS.

Change-Id: Idba258e465a8d657372dbeb6cb734744d493e5d4
Reviewed-on: https://go-review.googlesource.com/128416
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agonet: reduce TestSplice/big's memory usage
Daniel Martí [Wed, 8 Aug 2018 12:53:10 +0000 (13:53 +0100)]
net: reduce TestSplice/big's memory usage

The old code used splice on a 2GB []byte when not in short mode, meaning
that running 'go test net' when one had 4GB or less free memory would
easily result in "out of memory" runtime panics.

Instead, use a much smaller size that is still big enough to not fit
into a single splice(2) syscall. The new size is just 5MB, so the test
uses a fraction of the memory it used to, and there's no longer a need
for a different size on short mode.

This also speeds up the test, which goes from ~1.23s to ~0.01s on my
laptop.

Fixes #26867.

Change-Id: Iae1daa5c0995b549f41992f44339be32ca1ee5e4
Reviewed-on: https://go-review.googlesource.com/128535
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Andrei Tudor Călin <mail@acln.ro>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agocmd/go: 3 cmd/go tests (>8s) made as non-short scripts
Gn Shivakumar [Sun, 29 Jul 2018 17:56:52 +0000 (23:26 +0530)]
cmd/go: 3 cmd/go tests (>8s) made as non-short scripts

* TestAtomicCoverpkgAll -> Script/cover_atomic_pkgall.txt and make it
* non-short
* TestCoverpkgAllRuntime -> Script/cover_pkgall_runtime.txt and make it
* non-short
* TestCpuprofileTwice -> Script/cpu_profile_twice.txt and make it
* non-short
* TestGoTestMainTwice -> make it non-short

Updates #26472

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

5 years agocmd/go: make 'go get <module>@none' idempotent
Bryan C. Mills [Wed, 1 Aug 2018 17:22:02 +0000 (13:22 -0400)]
cmd/go: make 'go get <module>@none' idempotent

Before this change, 'go get <module>@none' for a module not in the build list
would add the module to go.mod (with the explicit version string "none").
Subsequent go commands would fail with 'invalid module version "none"'.

Change-Id: Iebcaeab89eb19959f0a9aeda836f179962953313
Reviewed-on: https://go-review.googlesource.com/127215
Reviewed-by: Russ Cox <rsc@golang.org>
5 years agocmd/go/internal/load: remove unused argument from Lookup
Bryan C. Mills [Mon, 6 Aug 2018 17:59:30 +0000 (13:59 -0400)]
cmd/go/internal/load: remove unused argument from Lookup

Change-Id: Ia2948a88c6d45a31be17b3d7415559cd53c289ce
Reviewed-on: https://go-review.googlesource.com/128015
Reviewed-by: Russ Cox <rsc@golang.org>
5 years agocmd/go/internal/load: pass the importer's package path when checking visibility
Bryan C. Mills [Fri, 3 Aug 2018 17:43:17 +0000 (13:43 -0400)]
cmd/go/internal/load: pass the importer's package path when checking visibility

A module like "gopkg.in/macaroon.v2" might have a test with a "_test" package
suffix (see https://golang.org/cmd/go/#hdr-Test_packages).
When we compile that test, its ImportStack entry includes the "_test" suffix
even though nothing else can actually import it via that path.
When we look up the module containing such a package, we must use the original
path, not the suffixed one.

On the other hand, an actual importable package may also be named with the
suffix "_test", so we need to be careful not to strip the suffix if it is
legitimately part of the path. We cannot distinguish that case by examining
srcDir or the ImportStack: the srcDir contaning a module doesn't necessarily
bear any relationship to its import path, and the ImportStack doesn't tell us
whether the suffix is part of the original path.

Fortunately, LoadImport usually has more information that we can use: it
receives a parent *Package that includes the original import path.

Fixes #26722

Change-Id: I1f7a4b37dbcb70e46af1caf9a496dfdd59ae8b17
Reviewed-on: https://go-review.googlesource.com/127796
Reviewed-by: Russ Cox <rsc@golang.org>
5 years agocmd/go: fix outdated comments
Bryan C. Mills [Mon, 6 Aug 2018 19:42:26 +0000 (15:42 -0400)]
cmd/go: fix outdated comments

Change-Id: I09532546c96b3758f76528fb5010dafc638139b8
Reviewed-on: https://go-review.googlesource.com/128135
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agosyscall/js: extend ValueOf to support arrays and objects
Richard Musiol [Tue, 31 Jul 2018 13:12:57 +0000 (15:12 +0200)]
syscall/js: extend ValueOf to support arrays and objects

This commits adds []interface{} and map[string]interface{} as quick
ways to create JavaScript arrays and objects. They correspond to the
JavaScript notations [...] and {...}. A type alias can be used for
a concise notation.

Change-Id: I98bb08dbef1e0f3bd3d65c732d6b09e1520026ba
Reviewed-on: https://go-review.googlesource.com/126855
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/asm/internal/arch: add package definition
Mario Arranz [Mon, 6 Aug 2018 18:50:41 +0000 (18:50 +0000)]
cmd/asm/internal/arch: add package definition

The package arch didn't have a definition as you can see in https://tip.golang.org/pkg/cmd/asm/internal/arch/

Change-Id: I07653b396393a75c445d04dbae5e22e90a0d5133
GitHub-Last-Rev: a859e9410f38073853687b933f53eb6570af3216
GitHub-Pull-Request: golang/go#26817
Reviewed-on: https://go-review.googlesource.com/127929
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agodoc: describe cgo ptr->uintptr changes for 1.11.
Keith Randall [Mon, 6 Aug 2018 17:17:52 +0000 (10:17 -0700)]
doc: describe cgo ptr->uintptr changes for 1.11.

Fixes #26721

Change-Id: Icc4660327a9ba668c88f8d9e0b9f206ba8f6dc27
Reviewed-on: https://go-review.googlesource.com/127975
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/go: fix go get fail when GIT_TRACE set
LE Manh Cuong [Mon, 30 Jul 2018 18:11:32 +0000 (01:11 +0700)]
cmd/go: fix go get fail when GIT_TRACE set

GIT_TRACE write message to stderr, while run1 merge both stdout and
stderr. So function which call run1 and rely on its output will failed
to parse the result when run1 success.

By using cmd.Output(), we ensure only cmd standard out is returned.

Fixes #19682

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

5 years agocmd/go: fix unnecessary plural
Kevin Burke [Wed, 1 Aug 2018 04:43:07 +0000 (21:43 -0700)]
cmd/go: fix unnecessary plural

"expanded imports paths" should read "expanded import paths." Run
mkalldocs.sh to pick up other changes which were not committed to
alldocs.go.

Change-Id: Iaa61e022d65f9464e8ff93a92cfba27dadf679cf
Reviewed-on: https://go-review.googlesource.com/127157
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/internal/objfile: only consider executable segments for load address
Ian Lance Taylor [Fri, 3 Aug 2018 21:52:54 +0000 (14:52 -0700)]
cmd/internal/objfile: only consider executable segments for load address

Reportedly on some new Fedora systems the linker is producing extra
load segments, basically making the dynamic section non-executable.
We were assuming that the first load segment could be used to
determine the program's load offset, but that is no longer true.
Use the first executable load segment instead.

Fixes #26369

Change-Id: I5ee31ddeef2e8caeed3112edc5149065a6448456
Reviewed-on: https://go-review.googlesource.com/127895
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agoos: document that Remove removes only empty directories
Ian Lance Taylor [Fri, 3 Aug 2018 16:55:44 +0000 (09:55 -0700)]
os: document that Remove removes only empty directories

Fixes #26507

Change-Id: I967e4f897ca891c70ca8bb0e66b984530c240815
Reviewed-on: https://go-review.googlesource.com/127835
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
5 years agomath/rand: improve package documentation
Benjamin Cable [Thu, 2 Aug 2018 13:54:16 +0000 (14:54 +0100)]
math/rand: improve package documentation

Notify readers that interval notation is used.
Fixes: #26765
Change-Id: Id02a7fcffbf41699e85631badeee083f5d4b2201
Reviewed-on: https://go-review.googlesource.com/127549
Reviewed-by: Rob Pike <r@golang.org>
5 years agocmd/go: don't crash in go fmt on invalid input when using modules
Ian Lance Taylor [Fri, 3 Aug 2018 18:27:32 +0000 (11:27 -0700)]
cmd/go: don't crash in go fmt on invalid input when using modules

Fixes #26792

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

5 years agoruntime: document assumption about wbBufFlush argument slots
Austin Clements [Fri, 3 Aug 2018 15:34:11 +0000 (11:34 -0400)]
runtime: document assumption about wbBufFlush argument slots

gcWriteBarrier and wbBufFlush assume that not writing to an argument
variable is sufficient to not clobber the corresponding argument slot.
This assumption lets us simplify the write barrier assembly code,
speed up the flush path, and reduce the stack usage of the write
barrier.

But it is an assumption, so this CL documents it to make this clear.

Alternatively, we could separate the register spill slots from the
argument slots in the write barrier, but that loses the advantages
above. On the other hand, it's extremely unlikely that we'll change
the behavior of the compiler to start clobbering argument slots (if
anything, we'd probably change it to *not* clobber argument slots even
if you wrote to the arguments).

Fixes #25512.

Change-Id: Ib2cf29c0d90956ca02b997ef6e7fa56fc8044efe
Reviewed-on: https://go-review.googlesource.com/127815
Reviewed-by: Cherry Zhang <cherryyz@google.com>
5 years agonet: skip flaky TestNotTemporaryRead on FreeBSD go1.11beta3
Brad Fitzpatrick [Fri, 3 Aug 2018 16:58:07 +0000 (16:58 +0000)]
net: skip flaky TestNotTemporaryRead on FreeBSD

Updates #25289

Change-Id: I662760b921be625aca988cd0b43c648ac5dfd814
Reviewed-on: https://go-review.googlesource.com/127837
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agocmd/internal/obj/arm64: fix incorrect rejection of legal instructions
Ben Shi [Wed, 1 Aug 2018 06:38:54 +0000 (06:38 +0000)]
cmd/internal/obj/arm64: fix incorrect rejection of legal instructions

"BFI $0, R1, $7, R2" is expected to copy bit 0~6 from R1 to R2, and
left R2's other bits unchanged.

But the assembler rejects it with error "illegal bit number", and
BFIW/SBFIZ/SBFIZW/UBFIZ/UBFIZW have the same problem.

This CL fixes that issue and adds corresponding test cases.

fixes #26736

Change-Id: Ie0090a0faa38a49dd9b096a0f435987849800b76
Reviewed-on: https://go-review.googlesource.com/127159
Run-TryBot: Ben Shi <powerman1st@163.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
5 years agocmd/go/internal/load: trim the " (test)" suffix from ImportStack paths
Bryan C. Mills [Fri, 3 Aug 2018 14:38:22 +0000 (10:38 -0400)]
cmd/go/internal/load: trim the " (test)" suffix from ImportStack paths

We were passing untrimmed paths to ModPackageModuleInfo, which was then failing
the build because it was asked to resolve an invalid path.

Fixes #26722

Change-Id: I043cc9c26f2188c5e005c0353620d9c55b339df9
Reviewed-on: https://go-review.googlesource.com/127795
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/go: disable ccache when setting HOME to non-existent dir
Mark Pulford [Fri, 3 Aug 2018 14:19:21 +0000 (00:19 +1000)]
cmd/go: disable ccache when setting HOME to non-existent dir

This fixes tests on systems where ccache is the default compiler.

Also simplify a prior workaround for this fault.

Fixed #26789

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

5 years agonet: update docs for unimplemented methods and functions
Mikio Hara [Fri, 3 Aug 2018 08:44:00 +0000 (17:44 +0900)]
net: update docs for unimplemented methods and functions

Change-Id: I54e651a952afa8928cc0204ba37092d3b2347266
Reviewed-on: https://go-review.googlesource.com/127737
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agodatabase/sql: fix driverStmt.Close() comment typo
Frédéric Guillot [Wed, 25 Jul 2018 23:36:11 +0000 (16:36 -0700)]
database/sql: fix driverStmt.Close() comment typo

Change-Id: I2256c850e071882b00c362da03abc8b021c1ec2a
Reviewed-on: https://go-review.googlesource.com/126015
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>