]> Cypherpunks repositories - gostls13.git/log
gostls13.git
6 years agocmd/go: set DepOnly on package when calling go list -deps
Paul Jolly [Fri, 11 May 2018 14:02:45 +0000 (15:02 +0100)]
cmd/go: set DepOnly on package when calling go list -deps

Currently .DepOnly is set when go list -test is invoked to help
distinguish those packages that matched the command line spec from those
which are dependencies (of test packages). This is also useful when
calling go list -deps for the same reason.

Change-Id: Ifc0e68dad0fd01355928793ef803691dee5f4f29
Reviewed-on: https://go-review.googlesource.com/112755
Run-TryBot: Paul Jolly <paul@myitcv.org.uk>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
6 years agocmd/vet: add support for vet-specific export data
Russ Cox [Fri, 20 Apr 2018 16:16:58 +0000 (12:16 -0400)]
cmd/vet: add support for vet-specific export data

An upcoming change to cmd/go will enable this functionality, which
allows vet to write down information about one package for use by
later invocation of vet that analyze code importing that package.

We've intended to do this for a long time, but the build caching was
necessary to have a decent way to manage the vet-specific export data.

This is also an experiment in building scalable whole-program analyses.
In the long term we'd like to allow other analyses to be invoked this way.

Change-Id: I34e4b70445786b2e8707ff6a0c00947bf1491511
Reviewed-on: https://go-review.googlesource.com/117099
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
6 years agoruntime/race: implement race detector for ppc64le
Lynn Boger [Thu, 29 Mar 2018 15:15:18 +0000 (11:15 -0400)]
runtime/race: implement race detector for ppc64le

This adds the support to enable the race detector for ppc64le.

Added runtime/race_ppc64le.s to manage the calls from Go to the
LLVM tsan functions, mostly converting from the Go ABI to the
PPC64 ABI expected by Clang generated code.

Changed racewalk.go to call racefuncenterfp instead of racefuncenter
on ppc64le to allow the caller pc to be obtained in the asm code
before calling the tsan version.

Changed the set up code for racecallbackthunk so it doesn't use
the autogenerated save and restore of the link register since that
sequence uses registers inconsistent with the normal ppc64 ABI.

Made various changes to recognize that race is supported for
ppc64le.

Ensured that tls_g is updated and accessible from race_linux_ppc64le.s
so that the race ctx can be obtained and passed to tsan functions.

This enables the race tests for ppc64le in cmd/dist/test.go and
increases the timeout when running the benchmarks with the -race
option to avoid timing out.

Updates #24354, #23731

Change-Id: Ib97dc7ac313e6313c836dc7d2fb698f9d8fba3ef
Reviewed-on: https://go-review.googlesource.com/107935
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/compile: fix wording in README
Yury Smolsky [Sun, 10 Jun 2018 09:27:47 +0000 (12:27 +0300)]
cmd/compile: fix wording in README

"Syntax analysis" sounds more familiar and fits the
item before, which says "lexical analysis".
If there was specific intention to the original wording,
I, as a reader, would like to see it instead of this
confusing wording.

Change-Id: Id32dbf75300a86b21cb9f35e54526184fe5df6cb
Reviewed-on: https://go-review.googlesource.com/117696
Reviewed-by: Robert Griesemer <gri@golang.org>
6 years agocmd/compile: add doc comment to the parseFiles function
Yury Smolsky [Sun, 10 Jun 2018 07:26:40 +0000 (10:26 +0300)]
cmd/compile: add doc comment to the parseFiles function

Change-Id: Ifa14557ba834865602c207297ccf0c63e93feb4c
Reviewed-on: https://go-review.googlesource.com/117695
Run-TryBot: Yury Smolsky <yury@smolsky.by>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
6 years agolib/time: update vendored tzdata to release 2018e
Alberto Donizetti [Mon, 11 Jun 2018 09:56:45 +0000 (11:56 +0200)]
lib/time: update vendored tzdata to release 2018e

It has been a long time since the last time the vendored zoneinfo in
lib/time was updated, and we're well into the freeze. Update it to the
lastest release from IANA.

Updates #22487

Change-Id: Ib9a8eb409554848285fc88363dbb04ed9d6d9eb0
Reviewed-on: https://go-review.googlesource.com/117855
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoruntime: restore r2 when restoring state from gobuf in gogo on ppc64x
Lynn Boger [Fri, 8 Jun 2018 15:07:18 +0000 (11:07 -0400)]
runtime: restore r2 when restoring state from gobuf in gogo on ppc64x

When using plugins with goroutines calling cgo, we hit a case where
an intermittent SIGSEGV occurs when referencing an address that is based
on r2 (TOC address). When the failure can be generated in gdb, the
contents of r2 is wrong even though the value in the current stack's
slot for r2 is correct. So that means it somehow switched to start
running the code in this function without passing through the beginning
of the function which had the correct value of r2 and stored it there.

It was noted that in runtime.gogo when the state is restored from
gobuf, r2 is not restored from its slot on the stack. Adding the
instruction to restore r2 prevents the SIGSEGV.

This adds a testcase under testplugin which reproduces the problem if
the program is run multiple times. The team who reported this problem
has verified it fixes the issue on their larger, more complex
application.

Fixes #25756

Change-Id: I6028b6f1f8775d5c23f4ebb57ae273330a28eb8f
Reviewed-on: https://go-review.googlesource.com/117515
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agocrypto, internal/cpu: fix s390x AES feature detection and update SHA implementations
Michael Munday [Thu, 24 May 2018 12:20:21 +0000 (13:20 +0100)]
crypto, internal/cpu: fix s390x AES feature detection and update SHA implementations

Hardware AES support in Go on s390x currently requires ECB, CBC
and CTR modes be available. It also requires that either the
GHASH or GCM facilities are available. The existing checks missed
some of these constraints.

While we're here simplify the cpu package on s390x, moving masking
code out of assembly and into Go code. Also, update SHA-{1,256,512}
implementations to use the cpu package since that is now trivial.

Finally I also added a test for internal/cpu on s390x which loads
/proc/cpuinfo and checks it against the flags set by internal/cpu.

Updates #25822 for changes to vet whitelist.

Change-Id: Iac4183f571643209e027f730989c60a811c928eb
Reviewed-on: https://go-review.googlesource.com/114397
Run-TryBot: Michael Munday <mike.munday@ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agonet: skip TestSendfileParts on dragonfly and solaris
Tobias Klauser [Mon, 11 Jun 2018 07:40:45 +0000 (09:40 +0200)]
net: skip TestSendfileParts on dragonfly and solaris

Skip it like on freebsd until there is proper a fix for #25809

Updates #25809

Change-Id: Id53c433aee75f2a992ab6a8d58d98fd1f8a6c1c6
Reviewed-on: https://go-review.googlesource.com/117698
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
6 years agonet: add TestSendfileParts
Alex Brainman [Mon, 11 Jun 2018 01:03:25 +0000 (11:03 +1000)]
net: add TestSendfileParts

Add test for freebsd issue #25809.

This test also fails on my Windows 10 Version 1803.
My hope is that adding new test will break one of our builders.

Updates #25722
Updates #25809

Change-Id: Ia103bc708b8fa3b9af57613acc44893f90b3fa18
Reviewed-on: https://go-review.googlesource.com/117775
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agosyscall: update TOKEN_ALL_ACCESS according to WinNT.h
Thanabodee Charoenpiriyakij [Sat, 9 Jun 2018 18:01:27 +0000 (01:01 +0700)]
syscall: update TOKEN_ALL_ACCESS according to WinNT.h

TOKEN_ALL_ACCESS was changed at some stage by Microsoft.

Updates #25775

Change-Id: I3e18914207a0020b2ebfb99f4e57aa55f9de813b
Reviewed-on: https://go-review.googlesource.com/117635
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
6 years agonet/http: add application/wasm mime type
Agniva De Sarker [Wed, 16 May 2018 13:59:41 +0000 (19:29 +0530)]
net/http: add application/wasm mime type

Although not part of http://mimesniff.spec.whatwg.org,
for WASM streaming compilation to happen, the response
needs to have the application/wasm MIME type
as mentioned here:
https://webassembly.github.io/spec/web-api/index.html#streaming-modules.

And all current browsers prevent streaming compilation
from happening if this MIME type is not present in the response.

The magic number is mentioned here:
https://webassembly.org/docs/binary-encoding

Since we are already adding WASM support, it makes sense
to support this MIME type.

Change-Id: I8dd7b413a8c438a5c23c29d843b42f6da2a20ba4
Reviewed-on: https://go-review.googlesource.com/113396
Reviewed-by: Richard Musiol <neelance@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agonet/http/httptest: deprecate ResponseRecorder.HeaderMap
Caleb Spare [Sun, 10 Jun 2018 03:14:44 +0000 (20:14 -0700)]
net/http/httptest: deprecate ResponseRecorder.HeaderMap

Users of this field are better off using Result instead.

Fixes #25763.

Change-Id: I4391afa6ed3873107628630adc1d409d77fb3f20
Reviewed-on: https://go-review.googlesource.com/117675
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/link: split pe .text section into .text and .rdata
Alex Brainman [Sat, 2 Jun 2018 05:35:25 +0000 (15:35 +1000)]
cmd/link: split pe .text section into .text and .rdata

Fixes #24725

Change-Id: I2864b88315ab15be036e8940d0a5884d876698d6
Reviewed-on: https://go-review.googlesource.com/115975
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agostrconv: add missing period to godoc comment
Mark Rushakoff [Sat, 9 Jun 2018 00:01:42 +0000 (00:01 +0000)]
strconv: add missing period to godoc comment

Change-Id: I90ba0a6e0c6ccdce16938eed09424308a84fc6fb
GitHub-Last-Rev: 66b6db1a674e6817209a69a7ccd1846d3b0e1900
GitHub-Pull-Request: golang/go#25801
Reviewed-on: https://go-review.googlesource.com/117575
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/go: add Solaris assembler syntax for gccgo buildid file
Ian Lance Taylor [Tue, 24 Apr 2018 22:09:38 +0000 (15:09 -0700)]
cmd/go: add Solaris assembler syntax for gccgo buildid file

The Solaris assembler uses a different syntax for section directives.

Fixes https://gcc.gnu.org/PR85429.

Change-Id: I1e54dffee3290046dbb68ba4e90ab795c6b72571
Reviewed-on: https://go-review.googlesource.com/109140
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/link: fix duplicated "unresolved inter-package jump" errors
Iskander Sharipov [Wed, 6 Jun 2018 17:13:19 +0000 (20:13 +0300)]
cmd/link: fix duplicated "unresolved inter-package jump" errors

This is extension to https://golang.org/cl/113955 that handled
duplicated "unresolved relocation" errors.

For platforms with trampoline support, additional error is generated
per each undefined symbol. This breaks TestUndefinedRelocErrors test
on these platforms.

Proposed fix:

1. Changes error text to be identical to normal undefined reloc.
   If relocation is undefined, jump to it will be unresolved
   as well.

2. Introduces a map that can be used by all sites that
   handle this kind of errors which makes it easier
   to report such errors exactly once.

Errors on ppc64 before this change (note first 4 lines):

main.defined1: unresolved inter-package jump to main.undefined()
main.defined1: unresolved inter-package jump to main.undefined()
main.defined2: unresolved inter-package jump to main.undefined()
main.defined2: unresolved inter-package jump to main.undefined()
main.defined1: relocation target main.undefined not defined
main.defined2: relocation target main.undefined not defined
runtime.main_main·f: function main is undeclared in the main package

After this change:

main.defined1: relocation target main.undefined not defined
main.defined2: relocation target main.undefined not defined
runtime.main_main·f: function main is undeclared in the main package

Because of (1), errors output is the same on all platforms now.

Fixes #25753

Change-Id: Ic3084202a6fc5d4a6d2d0a93344f012b37fe58ed
Reviewed-on: https://go-review.googlesource.com/116676
Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agomisc/wasm: set non-empty default for os.Args
Richard Musiol [Fri, 8 Jun 2018 16:28:37 +0000 (18:28 +0200)]
misc/wasm: set non-empty default for os.Args

os.Args is usually never empty and the flag package panics if it is.
This commit makes os.Args default to ["js"] for js/wasm.

Change-Id: Iba527145686487b052da438fca40159e57e61a81
Reviewed-on: https://go-review.googlesource.com/117475
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoruntime: fix pprof livelock on arm
philhofer [Wed, 6 Jun 2018 19:05:36 +0000 (12:05 -0700)]
runtime: fix pprof livelock on arm

On 32-bit architectures without native 64-bit atomic instructions,
64-bit atomics are emulated using spinlocks. However,
the sigprof handling code expects to be able to perform
64-bit atomic operations in signal handlers. Spinning on an
acquired spinlock in a signal handler leads to a livelock.
This is issue #20146.

The original fix for #20146 did not include arm in
the list of architectures that need to work around portability
issues in the sigprof handler code. The unit test designed to
catch this issue does not fail on arm builds because arm uses
striped spinlocks, and thus the livelock takes many minutes
to reproduce. This is issue #24260. (This patch doesn't completely
fix #24260 on go1.10.2 due to issue #25785, which is probably
related to the arm cas kernel helpers. Those have been removed
at tip.)

With this patch applied, I was able to run the reproducer for
issue #24260 for more than 90 minutes without reproducing the
livelock. Without this patch, the livelock took as little as
8 minutes to reproduce.

Fixes #20146
Updates #24260

Change-Id: I64bf53a14d53c4932367d919ac55e17c99d87484
Reviewed-on: https://go-review.googlesource.com/117057
Run-TryBot: Philip Hofer <phofer@umich.edu>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
6 years agocmd/cover: fix TestCoverHTML on Plan 9
David du Colombier [Fri, 8 Jun 2018 08:14:29 +0000 (10:14 +0200)]
cmd/cover: fix TestCoverHTML on Plan 9

CL 116975 added TestCoverHTML. However, this test is failing
on Plan 9, because the GNU diff tool is called "ape/diff"
instead of "diff" on Plan 9.

This change replaces the "diff" command by the "ape/diff"
command on Plan 9.

Fixes #25795.

Change-Id: I15b49868cd09f3f977aa13fffdfc430c882bf757
Reviewed-on: https://go-review.googlesource.com/117415
Run-TryBot: David du Colombier <0intro@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agocmd/compile: mark BS{F,R}L as clobbering flags
Keith Randall [Fri, 8 Jun 2018 00:25:28 +0000 (17:25 -0700)]
cmd/compile: mark BS{F,R}L as clobbering flags

Turns out it doesn't currently matter, as these ops are always issued
together with a BTSL which does clobber flags. So I can't write a test
that currently fails. But better to be future-proof.

BS{F,R}Q generates flags, so it doesn't need to be marked as clobbering.

Change-Id: I70daea154023fd435fac696bf3a384803c647cd3
Reviewed-on: https://go-review.googlesource.com/117375
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agocmd/cover: fix test on Solaris
David Symonds [Fri, 8 Jun 2018 00:33:54 +0000 (10:33 +1000)]
cmd/cover: fix test on Solaris

Solaris diff doesn't know about -d (a.k.a. --minimal).

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

6 years agocmd/cover: fix sorting of profile segment boundaries, again
David Symonds [Thu, 7 Jun 2018 10:44:17 +0000 (20:44 +1000)]
cmd/cover: fix sorting of profile segment boundaries, again

This is a refinement of CL 114855, which fixed the empty clause case,
but broke some other cases where segment boundaries can coincide
for other reasons.

Fixes #25767.

Change-Id: I2a387c83f9d651c8358f3e11b03f6167af0eb8bf
Reviewed-on: https://go-review.googlesource.com/116976
Run-TryBot: David Symonds <dsymonds@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
6 years agogo/types: extend cycle detection past simple type cycles
Robert Griesemer [Mon, 4 Jun 2018 22:42:12 +0000 (15:42 -0700)]
go/types: extend cycle detection past simple type cycles

This change improves upon cycle detection by taking into account
cycles involving constants, variables, _and_ types. All new code
(except for the additional tests) is guarded by the useCycleMarking
(internal) flag and thus can be disabled on short notice if it
introduced new problems. (The intent is to remove this flag shortly
after 1.11 is released.)

The test suite has been extended with various additional (and mostly
esoteric) test cases which now correctly report cycles. A handful of
existing test cases now report additional errors, but those are mostly
esoteric cases. Overall, this is an improvement over the status quo.

Fixes #8699.
For #20770.

Change-Id: I6086719acd0d5200edca4a3dbe703d053496af31
Reviewed-on: https://go-review.googlesource.com/116815
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
6 years agocmd/cover: add test for HTML output
David Symonds [Thu, 7 Jun 2018 10:25:10 +0000 (20:25 +1000)]
cmd/cover: add test for HTML output

This adds a case for what was fixed in 4fe688c to prevent regression;
a follow-on change will address #25767.

Change-Id: Iced8cc10e2993ef7caf7e9c59ffbc7147d78ddd7
Reviewed-on: https://go-review.googlesource.com/116975
Run-TryBot: David Symonds <dsymonds@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/go: don't refuse to update a present package only because of its source configuration
David Symonds [Wed, 16 May 2018 23:39:21 +0000 (09:39 +1000)]
cmd/go: don't refuse to update a present package only because of its source configuration

If a package is checked out in the right place, but uses, for instance,
an unusual Git remote configuration, don't refuse to update just because
cmd/go can't parse it. In most cases, `git pull -ff-only` (or the
equivalent in other VCSes) works just fine.

Updates #25432.

Change-Id: I1952a0e6e03f185f34029b186e1756c9549689e1
Reviewed-on: https://go-review.googlesource.com/113456
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
6 years agocrypto/tls: expand docs on client-side session ticket support
Filippo Valsorda [Thu, 7 Jun 2018 20:24:52 +0000 (16:24 -0400)]
crypto/tls: expand docs on client-side session ticket support

Users are sometimes confused why session tickets are not enabled even if
SessionTicketsDisabled is false.

Change-Id: I3b783d2cf3eed693a3ad6acb40a8003db7e0b648
Reviewed-on: https://go-review.googlesource.com/117255
Reviewed-by: Adam Langley <agl@golang.org>
6 years agocmd/go: restore "go list" exit code for missing binary packages
Bryan C. Mills [Thu, 7 Jun 2018 16:50:21 +0000 (12:50 -0400)]
cmd/go: restore "go list" exit code for missing binary packages

Prior to CL 108156, "go list" exited with code 0 if there were missing binary packages.
Restore that behavior to fix the failing TestBinaryOnlyPackages.

Fixes golang/go#25784.

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

6 years agodebug/pe: add IMAGE_FILE_MACHINE_ARM64
Brad Fitzpatrick [Thu, 7 Jun 2018 15:29:41 +0000 (15:29 +0000)]
debug/pe: add IMAGE_FILE_MACHINE_ARM64

Fixes #20849

Change-Id: If2a330185aa7e95eb84dccdbc4c7f3e9b970cca1
Reviewed-on: https://go-review.googlesource.com/117056
Reviewed-by: Matti Moell <matti.moell@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/go: skip TestBinaryOnlyPackages until it's fixed
Brad Fitzpatrick [Thu, 7 Jun 2018 15:46:19 +0000 (15:46 +0000)]
cmd/go: skip TestBinaryOnlyPackages until it's fixed

Updates #25784

Change-Id: I638eab82b026d3df89da532b5cc3f5c06b02d6c8
Reviewed-on: https://go-review.googlesource.com/117075
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

6 years agocrypto: randomly read an extra byte of randomness in some places.
Adam Langley [Mon, 18 Sep 2017 21:49:21 +0000 (14:49 -0700)]
crypto: randomly read an extra byte of randomness in some places.

Code has ended up depending on things like RSA's key generation being
deterministic given a fixed random Reader. This was never guaranteed and
would prevent us from ever changing anything about it.

This change makes certain calls randomly (based on the internal
fastrand) read an extra byte from the random Reader. This helps to
ensure that code does not depend on internal details.

I've not added this call in the key generation of ECDSA and DSA because,
in those cases, key generation is so obvious that it probably is
acceptable to do the obvious thing and not worry about code that depends
on that.

This does not affect tests that use a Reader of constant bytes (e.g. a
zeroReader) because shifting such a stream is a no-op. The stdlib uses
this internally (which is fine because it can be atomically updated if
the crypto libraries change).

It is possible that external tests could be doing the same and would
thus break if we ever, say, tweaked the way RSA key generation worked.
I feel that addressing that would be more effort than it's worth.

Fixes #21915

Change-Id: I84cff2e249acc921ad6eb5527171e02e6d39c530
Reviewed-on: https://go-review.googlesource.com/64451
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

6 years agoencoding/asn1: gofmt
Tobias Klauser [Thu, 7 Jun 2018 07:38:18 +0000 (09:38 +0200)]
encoding/asn1: gofmt

CL 113837 introduced some changes which were not properly gofmt'ed, fix them.

Change-Id: I89329063f9c468238051e45380d752e66efdb939
Reviewed-on: https://go-review.googlesource.com/116895
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agointernal/cpu: convert CRLF to LF line ending, and some superfulous space
Zhou Peng [Fri, 25 May 2018 14:34:45 +0000 (14:34 +0000)]
internal/cpu: convert CRLF to LF line ending, and some superfulous space

Change-Id: Ie355f06e9be93d7f7501f697a94ff83d6d0826a2
Reviewed-on: https://go-review.googlesource.com/114556
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoruntime: fix typo in runqput comment
cch123 [Thu, 7 Jun 2018 10:08:48 +0000 (10:08 +0000)]
runtime: fix typo in runqput comment

Change-Id: Idd88a1d9420545e3e326f8e3b57a38d8c7515555
GitHub-Last-Rev: 59528f552238eb4070cb9a66c1dbfafd6bc3808d
GitHub-Pull-Request: golang/go#25779
Reviewed-on: https://go-review.googlesource.com/116935
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/go: final edits for add go list -cgo and -export
Russ Cox [Thu, 19 Apr 2018 14:54:12 +0000 (10:54 -0400)]
cmd/go: final edits for add go list -cgo and -export

These got lost because I violated the cardinal rule of Gerrit
which is never click the Submit button in the web UI.

Change-Id: I8ccdfb5d8691960f244941036d33fb5a5a3f0c9a
Reviewed-on: https://go-review.googlesource.com/117015
Reviewed-by: Russ Cox <rsc@golang.org>
6 years agocmd/go/internal: add wasm magic header
Agniva De Sarker [Thu, 7 Jun 2018 07:13:56 +0000 (12:43 +0530)]
cmd/go/internal: add wasm magic header

This is needed when we are re-building to the wasm target.

Fixes #25774

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

6 years agocmd/go: add go list -cgo and -export
Russ Cox [Thu, 19 Apr 2018 14:54:12 +0000 (10:54 -0400)]
cmd/go: add go list -cgo and -export

We want package analysis tools to be able to ask cmd/go for
cgo-translated files and for the names of files holding export
type information, instead of reinventing that logic themselves.
Allow them to do so, with the new list -cgo and -export flags.

Change-Id: I860df530d8dcc130f1f328413381b5664cc81c3b
Reviewed-on: https://go-review.googlesource.com/108156
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
6 years agoruntime: remove unused darwinVersion and getDarwinVersion
Tobias Klauser [Thu, 7 Jun 2018 10:17:40 +0000 (12:17 +0200)]
runtime: remove unused darwinVersion and getDarwinVersion

They are unused since CL 114799.

Also remove consts _CTL_KERN and _KERN_OSRELEASE previously used by
getDarwinVersion.

Change-Id: I51b701e8effbe4dd4301b0e6d52e8885469032f4
Reviewed-on: https://go-review.googlesource.com/116955
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoflag: removed the colon after "Usage" in the documentation
hellozee [Thu, 7 Jun 2018 05:14:23 +0000 (05:14 +0000)]
flag: removed the colon after "Usage" in the documentation

Removing the colon will make the "Usage" and "Command line flag syntax" in the docs, a header when interpreted by godoc.

Fixes #25749

Change-Id: Ifc5572e171db1aaef9775b1d6c86091a8f2528fd
GitHub-Last-Rev: 1b579734308cbcb96f17d945b9c7af70e259cb5b
GitHub-Pull-Request: golang/go#25750
Reviewed-on: https://go-review.googlesource.com/116555
Reviewed-by: Rob Pike <r@golang.org>
6 years agocrypto/cipher: replace NewGCMWithNonceAndTagSize with NewGCMWithTagSize
212472270 [Tue, 5 Jun 2018 23:15:40 +0000 (16:15 -0700)]
crypto/cipher: replace NewGCMWithNonceAndTagSize with NewGCMWithTagSize

This function was added during the Go 1.11 dev cycle and isn't part of
the API compatibility promise yet.

In the previous implementation, NewGCMWithNonceAndTagSize was being used
as a helper function for NewGCM, NewGCMWithTagSize, and NewGCMWithNonceSize.
With the removal of Nonce size from the name and parameters, we needed to
add an unexported helper function newGCMWithNonceAndTagSize.

Fixes #24977

Change-Id: Ie70f2a192d0556c4f890deb62e68cff6bbbccd33
Reviewed-on: https://go-review.googlesource.com/116435
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agocmd/compile: fix panic-okay-to-inline change; adjust tests
David Chase [Wed, 6 Jun 2018 16:38:35 +0000 (12:38 -0400)]
cmd/compile: fix panic-okay-to-inline change; adjust tests

This line of the inlining tuning experiment
https://go-review.googlesource.com/c/go/+/109918/1/src/cmd/compile/internal/gc/inl.go#347
was incorrectly rewritten in a later patch to use the call
cost, not the panic cost, and thus the inlining of panic
didn't occur when it should.  I discovered this when I
realized that tests should have failed, but didn't.

Fix is to make the correct change, and also to modify the
tests that this causes to fail.  One test now asserts the
new normal, the other calls "ppanic" instead which is
designed to behave like panic but not be inlined.

Change-Id: I423bb7f08bd66a70d999826dd9b87027abf34cdf
Reviewed-on: https://go-review.googlesource.com/116656
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
6 years agogo/types: add missing test case for https://golang.org/cl/116735
Robert Griesemer [Wed, 6 Jun 2018 19:35:09 +0000 (12:35 -0700)]
go/types: add missing test case for https://golang.org/cl/116735

Missed this in the prior submit.

For #24182.

Change-Id: If8349d39c80b7ff57bc0c857985f9e52241321b8
Reviewed-on: https://go-review.googlesource.com/116775
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agogo/types: don't report errors referring to invalid types or operands
Robert Griesemer [Wed, 6 Jun 2018 18:36:35 +0000 (11:36 -0700)]
go/types: don't report errors referring to invalid types or operands

Such errors are likely spurious and caused by previously reported
errors; they don't add valuable information. Simply drop them.

Fixes #24182.

Change-Id: I0ac48c41647c628aa7636b29eaedfd9d01913762
Reviewed-on: https://go-review.googlesource.com/116735
Reviewed-by: Alan Donovan <adonovan@google.com>
6 years agodatabase/sql: update doc related to per-connection state
Eugene Kalinin [Wed, 6 Jun 2018 15:01:02 +0000 (18:01 +0300)]
database/sql: update doc related to per-connection state

Fixes #25330

Change-Id: I41b5b3459ed7808d18112ec02d734e2268099a81
Reviewed-on: https://go-review.googlesource.com/116596
Reviewed-by: Daniel Theophanes <kardianos@gmail.com>
6 years agoREADME: linkify some paths
Suriyaa Sundararuban [Wed, 6 Jun 2018 16:33:36 +0000 (18:33 +0200)]
README: linkify some paths

Change-Id: I77e31954f6d92f769934843bbba9f990f330f50a
Reviewed-on: https://go-review.googlesource.com/116675
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocrypto/x509: use SecItemExport instead of deprecated SecKeychainItemExport
Tobias Klauser [Tue, 5 Jun 2018 20:41:10 +0000 (22:41 +0200)]
crypto/x509: use SecItemExport instead of deprecated SecKeychainItemExport

SecKeychainItemExport is deprecated as of macOS 10.7. The minimum
supported version is macOS 10.10, so use SecItemExport instead.

While at it also bump macosx-version-min to 10.10 and
__MAC_OS_X_VERSION_MAX_ALLOWED to 101300 (for macOS 10.13).

Tested on macOS 10.10, 10.11 and 10.12.

Updates #23122

Change-Id: Id4cd6a5cea93315791253dc248e40e5615760a6c
Reviewed-on: https://go-review.googlesource.com/116396
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agotest: add comments for all test actions
Yury Smolsky [Fri, 1 Jun 2018 10:14:48 +0000 (13:14 +0300)]
test: add comments for all test actions

Every action has a short annotation.
The errorCheck function has a comment adapted from errchk script.

Removed redundant assigments to tmpDir.

Change-Id: Ifdd1284de046a0ce2aad26bd8da8a8e6a7707a8e
Reviewed-on: https://go-review.googlesource.com/115856
Run-TryBot: Yury Smolsky <yury@smolsky.by>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/compile: fix OffPtr with negative offset on wasm
Richard Musiol [Wed, 6 Jun 2018 11:10:16 +0000 (13:10 +0200)]
cmd/compile: fix OffPtr with negative offset on wasm

The wasm archtecture was missing a rule to handle OffPtr with a
negative offset. This commit makes it so OffPtr always gets lowered
to I64AddConst.

Fixes #25741

Change-Id: I1d48e2954e3ff31deb8cba9a9bf0cab7c4bab71a
Reviewed-on: https://go-review.googlesource.com/116595
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>

6 years agoreflect: add StructOf test case that gccgo used to fail
Ian Lance Taylor [Tue, 5 Jun 2018 23:57:49 +0000 (16:57 -0700)]
reflect: add StructOf test case that gccgo used to fail

Updates #25284

Change-Id: I8ca382dd85b428ad6899d9277cf7f3ce34e35e9a
Reviewed-on: https://go-review.googlesource.com/116416
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
6 years agonet/http: remove an allocation in ServeMux
Brad Fitzpatrick [Tue, 5 Jun 2018 21:06:17 +0000 (21:06 +0000)]
net/http: remove an allocation in ServeMux

Also, add a benchmark variant ("SkipServe") that only benchmarks the
ServeMux handler selection path.

name                  old time/op    new time/op    delta
ServeMux_SkipServe-4    74.2µs ± 2%    60.6µs ± 1%   -18.31%   (p=0.000 n=10+9)

name                  old alloc/op   new alloc/op   delta
ServeMux_SkipServe-4    2.62kB ± 0%   0.00kB ±NaN%  -100.00%  (p=0.000 n=10+10)

name                  old allocs/op  new allocs/op  delta
ServeMux_SkipServe-4       180 ± 0%        0 ±NaN%  -100.00%  (p=0.000 n=10+10)

Updates #25383

Change-Id: Icfbb3b977e309093d032e922d1b4f254df6f5955
Reviewed-on: https://go-review.googlesource.com/116378
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
6 years agocmd/go: output coverage report even if there are no test files
Dennis Kuhnert [Tue, 29 May 2018 15:39:00 +0000 (17:39 +0200)]
cmd/go: output coverage report even if there are no test files

When using test -cover or -coverprofile the output for "no test files"
is the same format as for "no tests to run".

Fixes #24570

Change-Id: If05609411676d42d94c1feac4bc839974fae2cc1
Reviewed-on: https://go-review.googlesource.com/115095
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/compile: terminate compilation if type-checking fails
Robert Griesemer [Tue, 5 Jun 2018 17:19:03 +0000 (10:19 -0700)]
cmd/compile: terminate compilation if type-checking fails

There is no benefit in continuing compilation if there
are type-checking errors. This will increase robustness
of the compiler in the presence of errors.

Fixes #22909.

Change-Id: I1c70c667e5927646ba3d0f370e33705165620f12
Reviewed-on: https://go-review.googlesource.com/116335
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agodoc: document Go 1.10.3
Filippo Valsorda [Tue, 5 Jun 2018 21:12:29 +0000 (17:12 -0400)]
doc: document Go 1.10.3

Change-Id: Ifc774bb9267baa773e91c617204329d3e04bd4b7
Reviewed-on: https://go-review.googlesource.com/116363
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
6 years agodoc: document Go 1.9.7
Filippo Valsorda [Tue, 5 Jun 2018 21:10:29 +0000 (17:10 -0400)]
doc: document Go 1.9.7

Change-Id: I10dededb41162a99dbc42792a9d314c6dabddcca
Reviewed-on: https://go-review.googlesource.com/116362
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
6 years agocmd/compile: avoid nil pointer deref in debugging output
Robert Griesemer [Tue, 5 Jun 2018 23:29:06 +0000 (16:29 -0700)]
cmd/compile: avoid nil pointer deref in debugging output

Found while tracking down another issue.

Change-Id: If06eee72ce3e3f45dc00b3b68670e1e4d99c87a7
Reviewed-on: https://go-review.googlesource.com/116455
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agonet/http: document Transport.Dial concurrency
Brad Fitzpatrick [Tue, 5 Jun 2018 19:49:53 +0000 (19:49 +0000)]
net/http: document Transport.Dial concurrency

Fixes #25019

Change-Id: I715e3bb560b2a0301240cecb09a5126ab04a666e
Reviewed-on: https://go-review.googlesource.com/116375
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/compile: revert internal parameter rename (from ".anonX" to "") before export
Robert Griesemer [Tue, 5 Jun 2018 19:48:51 +0000 (12:48 -0700)]
cmd/compile: revert internal parameter rename (from ".anonX" to "") before export

In the old binary export format, parameter names for parameter lists
which contained only types where never written, so this problem didn't
come up.

Fixes #25101.

Change-Id: Ia8b817f7f467570b05f88d584e86b6ef4acdccc6
Reviewed-on: https://go-review.googlesource.com/116376
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
6 years agoreflect: check that types match without calling TypeOf
Ian Lance Taylor [Fri, 1 Jun 2018 03:46:33 +0000 (20:46 -0700)]
reflect: check that types match without calling TypeOf

gccgo fails this test before CL 115577.

Updates #25284

Change-Id: Id4550b7b3e268f3c294420ed31c57ad3f1002b5e
Reviewed-on: https://go-review.googlesource.com/115635
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
6 years agocmd/link: fix duplicated "undefined reloc" errors
isharipo [Mon, 21 May 2018 18:00:01 +0000 (21:00 +0300)]
cmd/link: fix duplicated "undefined reloc" errors

For given program with 2 undefined relocations (main and undefined):

package main
func undefined()
func defined() int {
undefined()
undefined()
return 0
}
var x = defined()

"go tool link" produces these errors:

main.defined: relocation target main.undefined not defined
main.defined: relocation target main.undefined not defined
runtime.main_main·f: relocation target main.main not defined
main.defined: undefined: "main.undefined"
main.defined: undefined: "main.undefined"
runtime.main_main·f: undefined: "main.main"

After this CL is applied:

main.defined: relocation target main.undefined not defined
runtime.main_main·f: function main is undeclared in the main package

Fixes #10978
Improved error message for main proposed in #24809.

Change-Id: I4ba8547b1e143bbebeb4d6e29ea05d932124f037
Reviewed-on: https://go-review.googlesource.com/113955
Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoos: check setStickyBit error in mkdir
Eugene Kalinin [Fri, 1 Jun 2018 08:43:16 +0000 (11:43 +0300)]
os: check setStickyBit error in mkdir

If an error occurs, delete the newly created directory.

Change-Id: I97e960d24af32f027fb23d5ce3f61959e73f6fb0
Reviewed-on: https://go-review.googlesource.com/115715
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoruntime: handle windows callback on non-go thread
Bill Zissimopoulos [Sun, 3 Jun 2018 17:25:29 +0000 (17:25 +0000)]
runtime: handle windows callback on non-go thread

Adds an extra M in mstartm0 and accounts for it in checkdead. This allows Windows callbacks created with syscall.NewCallback and syscall.NewCallbackCDecl to be called on a non-Go thread.

Fixes #6751

Change-Id: I57626bc009a6370b9ca0827ab64b14b01dec39d4
GitHub-Last-Rev: d429e3eed923640edab580bdb47fcb81e75dbfe8
GitHub-Pull-Request: golang/go#25575
Reviewed-on: https://go-review.googlesource.com/114802
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agocmd/compile: fix printing of array types in error messages
Robert Griesemer [Tue, 5 Jun 2018 00:17:16 +0000 (17:17 -0700)]
cmd/compile: fix printing of array types in error messages

Fixes #23094.

Change-Id: I9aa36046488baa5f55cf2099e10cfb39ecd17b06
Reviewed-on: https://go-review.googlesource.com/116256
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoruntime: slightly better error message for assertion panics with identical looking...
Robert Griesemer [Mon, 4 Jun 2018 23:32:07 +0000 (16:32 -0700)]
runtime: slightly better error message for assertion panics with identical looking types

Fixes #18911.

Change-Id: Ice10f37460a4f0a66cddeacfe26c28045f5e60fe
Reviewed-on: https://go-review.googlesource.com/116255
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
6 years agostrconv: check for empty string in UnquoteChar
Rebecca Stambler [Mon, 4 Jun 2018 19:12:45 +0000 (15:12 -0400)]
strconv: check for empty string in UnquoteChar

The existing implementation panics on malformed input of an empty
string. strconv.Unquote validates the length of the inputs, but calling
UnquoteChar directly with an empty string leads to a panic, so add a
check for length. Also, add a test to go/constant to ensure that
MakeFromLiteral does not panic on malformed input such as
"const x = ''".

Change-Id: I4217e38db48a09a21ec414bbfb3087709da62904
Reviewed-on: https://go-review.googlesource.com/116215
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
6 years agonet: drop special case for macOS 10.7 and earlier
Tobias Klauser [Mon, 4 Jun 2018 18:06:30 +0000 (20:06 +0200)]
net: drop special case for macOS 10.7 and earlier

Updates #23122

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

6 years agoruntime: don't crash holding locks on racy timer access
Ian Lance Taylor [Fri, 1 Jun 2018 17:16:08 +0000 (10:16 -0700)]
runtime: don't crash holding locks on racy timer access

If we run into data corruption due to the program accessing timers in
a racy way, do a normal panic rather than a hard crash with "panic
holding locks". The hope is to make the problem less confusing for users.

Fixes #25686

Change-Id: I863417adf21f7f8c088675b67a3acf49a0cdef41
Reviewed-on: https://go-review.googlesource.com/115815
Reviewed-by: Austin Clements <austin@google.com>
6 years agotext/tabwriter: fix BenchmarkPyramid and BenchmarkRagged again
Josh Bleecher Snyder [Sun, 3 Jun 2018 14:26:16 +0000 (07:26 -0700)]
text/tabwriter: fix BenchmarkPyramid and BenchmarkRagged again

These were added in CL 106979. I got them wrong.
They were fixed in CL 111643. They were still wrong.
Hopefully this change will be the last fix.

With this fix, CL 106979 is allocation-neutral for BenchmarkRagged.
The performance results for BenchmarkPyramid reported in CL 111643 stand.

Change-Id: Id6a522e6602e5df31f504adf5a3bec9969c18649
Reviewed-on: https://go-review.googlesource.com/116015
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
6 years agonet: add js/wasm architecture
Richard Musiol [Sun, 4 Mar 2018 11:18:32 +0000 (12:18 +0100)]
net: add js/wasm architecture

This commit adds the js/wasm architecture to the net package.
The net package is not supported by js/wasm, but a simple fake
networking is available so tests of other packages that require
basic TCP sockets can pass. The tests of the net package itself
are mostly disabled.

Updates #18892

Change-Id: Id287200c39f0a3e23d20ef17260ca15ccdcca032
Reviewed-on: https://go-review.googlesource.com/109995
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoruntime: fix typo in the templateThread godoc
cch123 [Mon, 4 Jun 2018 15:20:07 +0000 (15:20 +0000)]
runtime: fix typo in the templateThread godoc

Change-Id: Ie8d563d39b88ab1631bc150d7d5bdbf1aa400f76
GitHub-Last-Rev: d092c8c8eb886fd9abad9bdaed7330a6cbd7f9a4
GitHub-Pull-Request: golang/go#25716
Reviewed-on: https://go-review.googlesource.com/116115
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
6 years agoruntime/race: update most syso files to compiler-rt fe2c72
Bryan C. Mills [Fri, 11 May 2018 22:40:54 +0000 (18:40 -0400)]
runtime/race: update most syso files to compiler-rt fe2c72

These were generated using the racebuild configuration from
https://golang.org/cl/115375, with the LLVM compiler-rt repository at
commit fe2c72c59aa7f4afa45e3f65a5d16a374b6cce26 for most platforms.

The Windows build is from an older compiler-rt revision, because the
compiler-rt build script for the Go race detector has been broken
since January 2017 (https://reviews.llvm.org/D28596).

Updates #24354.

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

6 years agosyscall: fix EpollWait for arm64
Wei Xiao [Thu, 31 May 2018 06:46:50 +0000 (06:46 +0000)]
syscall: fix EpollWait for arm64

The SYS_EPOLL_WAIT syscall doesn't exist on arm64. This CL implements EpollWait
with SYS_EPOLL_PWAIT syscall.

Change-Id: Ica9107a58d7da45351fe2e900f59bec5b7b18f39
Reviewed-on: https://go-review.googlesource.com/115735
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: Brad Fitzpatrick <bradfitz@golang.org>
6 years agonet/http: fix build errors on js/wasm target
Johan Brandhorst [Mon, 4 Jun 2018 15:03:05 +0000 (15:03 +0000)]
net/http: fix build errors on js/wasm target

The in-progress WASM port does not yet have sufficient automatic
testing performed against it, so these errors slipped through when
adding the new Fetch API backed http.Roundtripper.

Updates #25506

Change-Id: I84c5832452e3e6067a02d926f67d01aaca66b837
GitHub-Last-Rev: 064062b5fd256e7fce961a13a8ac00a135f60221
GitHub-Pull-Request: golang/go#25714
Reviewed-on: https://go-review.googlesource.com/116076
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/go: fix 'go get' compatibility for direct download of vgo-aware module
Russ Cox [Fri, 1 Jun 2018 19:47:29 +0000 (15:47 -0400)]
cmd/go: fix 'go get' compatibility for direct download of vgo-aware module

CL 109340 added “minimal module-awareness for legacy operation.”
One part of that is reinterpreting imports inside code trees with go.mod files
as using semantic import versioning, and converting them back to
legacy import paths by stripping the major version element
(for example, interpreting import "x.com/foo/v2/bar" as import "x.com/foo/bar").
This rewrite was not being applied during "go get", with the effect that once
you had the target code downloaded already, everything was fine,
but it didn't download and build successfully the first time.

Fixes #25687.

Change-Id: I3e122efdc8fd9a0a4e66f5aa3e6a99f90c7df779
Reviewed-on: https://go-review.googlesource.com/115797
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
6 years agocmd/asm/internal/asm: add extra AVX-512 tests
Iskander Sharipov [Fri, 1 Jun 2018 22:09:10 +0000 (01:09 +0300)]
cmd/asm/internal/asm: add extra AVX-512 tests

These tests were meant to be included into https://golang.org/cl/113315,
but were lost somewhere in the middle.

This CL adds hand-written AVX-512 tests that complement
auto-generated test suite.

It's worth including it, because:

- It covers every new Z-case explicitly
- Does checks every opcode suffix encoding

Change-Id: Id6da5f58773e07bef3d532fc3ca5db391d380ebf
Reviewed-on: https://go-review.googlesource.com/115858
Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
6 years agocmd/compile: include callee args section when checking frame too large
Keith Randall [Tue, 29 May 2018 23:44:36 +0000 (16:44 -0700)]
cmd/compile: include callee args section when checking frame too large

The stack frame includes the callee args section. At the point where
we were checking the frame size, that part of the frame had not been
computed yet. Move the check later so we can include the callee args size.

Fixes #20780
Update #25507

Change-Id: Iab97cb89b3a24f8ca19b9123ef2a111d6850c3fe
Reviewed-on: https://go-review.googlesource.com/115195
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
6 years agoall: update comment URLs from HTTP to HTTPS, where possible
Tim Cooper [Fri, 1 Jun 2018 20:29:59 +0000 (17:29 -0300)]
all: update comment URLs from HTTP to HTTPS, where possible

Each URL was manually verified to ensure it did not serve up incorrect
content.

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

6 years agotest: skip test/fixedbugs/bug345.go on windows
Yury Smolsky [Fri, 1 Jun 2018 20:42:23 +0000 (23:42 +0300)]
test: skip test/fixedbugs/bug345.go on windows

Before the CL 115277 we did not run the test on Windows,
so let's just go back to not running the test on Windows.
There is nothing OS-specific about this test,
so skipping it on Windows doesn't seem like a big deal.

Updates #25693
Fixes #25586

Change-Id: I1eb3e158b322d73e271ef388f8c6e2f2af0a0729
Reviewed-on: https://go-review.googlesource.com/115857
Run-TryBot: Yury Smolsky <yury@smolsky.by>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoruntime/trace: remove remaining NewContext reference
Hana Kim [Thu, 31 May 2018 20:14:04 +0000 (16:14 -0400)]
runtime/trace: remove remaining NewContext reference

This is a documentation error.

Change-Id: I083021f151f7e80a0b9083b98452ae1f5920640d
Reviewed-on: https://go-review.googlesource.com/115598
Reviewed-by: Peter Weinberger <pjw@google.com>
6 years agocmd/compile: fix comment to reference runtime.countrunes
Martin Möhrmann [Fri, 1 Jun 2018 17:43:58 +0000 (19:43 +0200)]
cmd/compile: fix comment to reference runtime.countrunes

Updates #24923

Change-Id: Ie5a1b54b023381b58df618080f3d742a50d46d8b
Reviewed-on: https://go-review.googlesource.com/115836
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agogo/types: remove visited flag for constants and variables (cleanup)
Robert Griesemer [Thu, 31 May 2018 22:18:21 +0000 (15:18 -0700)]
go/types: remove visited flag for constants and variables (cleanup)

Now that we have a color marking scheme for all objects, the
pre-existing 'visited' flag for constants and variables is
redundant: visited is the same as marking an object non-white.

Refactor the respective 'visited' flag logic from constDecl and
varDecl into the color switch in objDecl and remove the 'visited'
flag.

Follow-up on https://go-review.googlesource.com/c/go/+/114517 .

Change-Id: Ie20de65e3b26a5a6ff7b0eddc3d089f56be204e8
Reviewed-on: https://go-review.googlesource.com/115619
Reviewed-by: Alan Donovan <adonovan@google.com>
6 years agocmd/internal/obj/arm64: fix two issues in the assembler
Ben Shi [Sat, 26 May 2018 12:43:16 +0000 (12:43 +0000)]
cmd/internal/obj/arm64: fix two issues in the assembler

There are two issues in the arm64 assembler.

1. "CMPW $0x22220000, RSP" is encoded to 5b44a4d2ff031b6b, which
   is the combination of "MOVD $0x22220000, Rtmp" and
   "NEGSW Rtmp, ZR".
   The right encoding should be a combination of
   "MOVD $0x22220000, Rtmp" and "CMPW Rtmp, RSP".

2. "AND $0x22220000, R2, RSP" is encoded to 5b44a4d25f601b00,
   which is the combination of "MOVD $0x22220000, Rtmp" and
   an illegal instruction.
   The right behavior should be an error report of
   "illegal combination", since "AND Rtmp, RSP, RSP" is invalid
   in armv8.

This CL fixes the above 2 issues and adds more test cases.

fixes #25557

Change-Id: Ia510be26b58a229f5dfe8a5fa0b35569b2d566e7
Reviewed-on: https://go-review.googlesource.com/114796
Run-TryBot: Ben Shi <powerman1st@163.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
6 years agoos: add js/wasm architecture
Richard Musiol [Sun, 4 Mar 2018 11:16:18 +0000 (12:16 +0100)]
os: add js/wasm architecture

This commit adds the js/wasm architecture to the os package.

Access to the actual file system is supported through Node.js.

Updates #18892

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

6 years agoarchive/zip: remove unnecessary words in (*Writer).Close docs
Ian Lance Taylor [Thu, 31 May 2018 22:07:02 +0000 (15:07 -0700)]
archive/zip: remove unnecessary words in (*Writer).Close docs

Fixes #25599

Change-Id: I19ac3463682f662515feaf4c6132f55c12ba5386
Reviewed-on: https://go-review.googlesource.com/115618
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoencoding/hex: improve Decode and DecodeString docs
Josh Bleecher Snyder [Thu, 31 May 2018 19:30:19 +0000 (12:30 -0700)]
encoding/hex: improve Decode and DecodeString docs

Simplify the wording of both.

Make the DecodeString docs more accurate:
DecodeString returns a slice, not a string.

Change-Id: Iba7003f55fb0a37aafcbeee59a30492c0f68aa4e
Reviewed-on: https://go-review.googlesource.com/115615
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agogo/types: report object path in trace mode
Robert Griesemer [Thu, 31 May 2018 01:13:27 +0000 (18:13 -0700)]
go/types: report object path in trace mode

For debugging only; disabled (dead code) by default
unless internal constant trace flag is set to true.

For #8699.

Change-Id: Ib7b272c6ac8efacccbbbe24650ef500c5a9ddcf5
Reviewed-on: https://go-review.googlesource.com/115457
Reviewed-by: Alan Donovan <adonovan@google.com>
6 years agogo/types: better cycle reporting for some cyclic composite literals
Robert Griesemer [Wed, 9 May 2018 01:01:16 +0000 (18:01 -0700)]
go/types: better cycle reporting for some cyclic composite literals

To evaluate the type of composite literals, the type checker called
Checker.typ which breaks cycles. As a result, certain cycles were
not reported with actual cycle reporting, but caught due to other
uninitialized fields (with less nice error message).

The change now calls Checker.typExpr at the relevant call site.

For #18643.

Change-Id: Iecb3f0e1afb4585b85553b6c581212f52ac3a1c4
Reviewed-on: https://go-review.googlesource.com/115456
Reviewed-by: Alan Donovan <adonovan@google.com>
6 years agogo/types: use color-marking based cycle detection at package level
Robert Griesemer [Wed, 30 May 2018 20:48:13 +0000 (13:48 -0700)]
go/types: use color-marking based cycle detection at package level

The existing cycle detection scheme passes around a (type name)
path; when a type name re-appears in the path, a cycle is reported.
Indirections (as in *T, func(T), etc.) are broken by starting a new
(nil) path. The problem with this approach is that it doesn't work
for cycles involving alias type names since they may be invalid
even if there is an indirection. Furthermore, the path must be
passed around through all functions which is currently not the
case, which leads to less optimial error reporting.

The new code is using the previously introduced color marking
scheme and global object path for package-level cycle detection
(function-local cycle detection doesn't use the same code path
yet but is also much less important as cycles can only be created
using the type being declared).

The new code is guarded with an internal flag (useCycleMarking)
so it can be disabled in short notice if this change introduced
unexpected new issues.

Fixes #23139.
Fixes #25141.

For #18640.
For #24939.

Change-Id: I1bbf2d2d61a375cf5885b2de1df0a9819d63e5fa
Reviewed-on: https://go-review.googlesource.com/115455
Reviewed-by: Alan Donovan <adonovan@google.com>
6 years agogo/types: initial framework for marking-based cycle detection
Robert Griesemer [Thu, 24 May 2018 22:39:21 +0000 (15:39 -0700)]
go/types: initial framework for marking-based cycle detection

The existing code explicitly passes a (type name) path around
to determine cycles; it also restarts the path for types that
"break" a cycle (such as a pointer, function, etc.). This does
not work for alias types (whose cycles are broken in a different
way). Furthermore, because the path is not passed through all
type checker functions that need it, we can't see the path or
use it for detection of some cycles (e.g. cycles involving array
lengths), which required ad-hoc solutions in those cases.

This change introduces an explicit marking scheme for any kind
of object; an object is painted in various colors indicating
its state. It also introduces an object path (a stack) main-
tained with the Checker state, which is available in all type
checker functions that need access to it.

The change only introduces these mechanisms and exercises the
basic functionality, with no effect on the existing code for
now.

For #25141.

Change-Id: I7c28714bdafe6c8d9afedf12a8a887554237337c
Reviewed-on: https://go-review.googlesource.com/114517
Reviewed-by: Alan Donovan <adonovan@google.com>
6 years agotest: remove rundircmpout and cmpout actions
Yury Smolsky [Thu, 31 May 2018 15:51:00 +0000 (18:51 +0300)]
test: remove rundircmpout and cmpout actions

This CL removes the rundircmpout action completely
because it is not used anywhere.

The run case already looks for output files. Rename the cmpout action
mentioned in tests to the run action and remove "cmpout" from run.go.

Change-Id: I835ceb70082927f8e9360e0ea0ba74f296363ab3
Reviewed-on: https://go-review.googlesource.com/115575
Run-TryBot: Yury Smolsky <yury@smolsky.by>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/pprof: fix help message formatting error
Hana Kim [Thu, 31 May 2018 17:16:24 +0000 (13:16 -0400)]
cmd/pprof: fix help message formatting error

Pprof usage message includes "%" symbols. Misuse of Fprintf caused
the message to be interpreted as a format string and corrupted the usage
message.

Change-Id: I4732b491e2368cff9fdbfe070c125228d6f506fd
Reviewed-on: https://go-review.googlesource.com/115595
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoencoding/asn1: fix returned type for an Object Identifier
Constantin Konstantinidis [Sat, 19 May 2018 11:59:29 +0000 (13:59 +0200)]
encoding/asn1: fix returned type for an Object Identifier

Unmarshal/Marshal/Unmarshal was not idempotent as the Object Identifier
type was not returned through the interface. The limit case OID = 0
returns an error. The zero OID is 0.0

A test is fixed to use the Object Identifier type.
Other related test are added.

Fixes #11130

Change-Id: I15483a3126066c9b99cf5bd9c4b0cc15ec1d61ca
Reviewed-on: https://go-review.googlesource.com/113837
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
6 years agoreflect: reuse values during comparison of maps in DeepEqual
Zhou Peng [Thu, 31 May 2018 06:52:19 +0000 (06:52 +0000)]
reflect: reuse values during comparison of maps in DeepEqual

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

6 years agonet/http: use fake Transport network when running in Node
Johan Brandhorst [Thu, 31 May 2018 10:12:32 +0000 (10:12 +0000)]
net/http: use fake Transport network when running in Node

Replaces the existing local loopback check with a check to see
whether the program is being interpreted by Node. This means
tests that are run with Node will use the fake network while still
allowing users who are using js/wasm to talk to local networks.

Updates #25506

Change-Id: I8bc3c6808fa29293b7ac5f77b186140c4ed90b51
GitHub-Last-Rev: 43d26af7bc716b7a01dd8f47d7a2c2a2df549489
GitHub-Pull-Request: golang/go#25663
Reviewed-on: https://go-review.googlesource.com/115495
Reviewed-by: Agniva De Sarker <agniva.quicksilver@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoRevert "cmd/compile: ignore g register in liveness analysis"
Austin Clements [Tue, 22 May 2018 21:33:23 +0000 (17:33 -0400)]
Revert "cmd/compile: ignore g register in liveness analysis"

This reverts commit ea200340702cf3ccfac7c5db1f11bb65c80971c7 now
that CL 114695 fixed the root cause of #25504.

Change-Id: If437fc832983bd8793bde28ce0e2e64436a0596c
Reviewed-on: https://go-review.googlesource.com/114087
Reviewed-by: David Chase <drchase@google.com>
6 years agoRevert "testing: only compute b.N once when passed -count > 1"
Alberto Donizetti [Thu, 31 May 2018 12:04:07 +0000 (12:04 +0000)]
Revert "testing: only compute b.N once when passed -count > 1"

This reverts golang.org/cl/110775

Reason for revert: this is causing huge slow-dows on every run after
the 1st, on various benchmarks, on multiple architectures (see Issue
25622 for details). It's just a nice-to-have little optimization, and
we're near the 1st go1.11 beta release, so I'm reverting it.

Fixes #25622

Change-Id: I758ade4af4abf764abd8336d404396992d11a0c6
Reviewed-on: https://go-review.googlesource.com/115535
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
6 years agotest: eliminate use of Perl in fixedbugs/bug345.go
Yury Smolsky [Wed, 30 May 2018 16:46:59 +0000 (19:46 +0300)]
test: eliminate use of Perl in fixedbugs/bug345.go

To allow testing of fixedbugs/bug345.go in Go,
a new flag -n is introduced. This flag disables setting
of relative path for local imports and imports search path
to current dir, namely -D . -I . are not passed to the compiler.
Error regexps are fixed to allow running the test in temp directory.

This change eliminates the last place where Perl
script "errchk" was used.

Fixes #25586.

Change-Id: If085f466e6955312d77315f96d3ef1cb68495aef
Reviewed-on: https://go-review.googlesource.com/115277
Run-TryBot: Yury Smolsky <yury@smolsky.by>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agotesting: make indentation consistent in sub-tests
Yury Smolsky [Tue, 15 May 2018 06:55:46 +0000 (09:55 +0300)]
testing: make indentation consistent in sub-tests

Instead of mixed usage of spaces and tabs for indentation,
just use 4 spaces instead of one tab.

This test:

func TestX(t *testing.T) {
t.Error("1\nnew line")
t.Error("2")
t.Error("3")
t.Run("Y", func(t *testing.T) {
t.Error("2")
t.Error("2b\nnew line")
t.Run("Z", func(t *testing.T) {
t.Error("3\nnew line")
})
})
t.Error("4")
}

produces following output:

--- FAIL: TestX (0.00s)
    indent_test.go:6: 1
new line
    indent_test.go:7: 2
    indent_test.go:8: 3
    --- FAIL: TestX/Y (0.00s)
indent_test.go:10: 2
indent_test.go:11: 2b
    new line
--- FAIL: TestX/Y/Z (0.00s)
    indent_test.go:13: 3
new line
    indent_test.go:16: 4
FAIL

Fixes #25369

Change-Id: Ib3b5da45ab3ee670c6e8a23172e7cbefb94c5e60
Reviewed-on: https://go-review.googlesource.com/113177
Run-TryBot: Yury Smolsky <yury@smolsky.by>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
6 years agonet: add ListenConfig, Dialer.Control to permit socket opts before listen/dial
Audrius Butkevicius [Mon, 28 May 2018 01:47:21 +0000 (02:47 +0100)]
net: add ListenConfig, Dialer.Control to permit socket opts before listen/dial

Existing implementation does not provide a way to set options such as
SO_REUSEPORT, that has to be set prior the socket being bound.

New exposed API:
pkg net, method (*ListenConfig) Listen(context.Context, string, string) (Listener, error)
pkg net, method (*ListenConfig) ListenPacket(context.Context, string, string) (PacketConn, error)
pkg net, type ListenConfig struct
pkg net, type ListenConfig struct, Control func(string, string, syscall.RawConn) error
pkg net, type Dialer struct, Control func(string, string, syscall.RawConn) error

Fixes #9661

Change-Id: If4d275711f823df72d3ac5cc3858651a6a57cccb
Reviewed-on: https://go-review.googlesource.com/72810
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/go: accept more safe CFLAGS/LDFLAGS
Ian Lance Taylor [Wed, 30 May 2018 22:07:04 +0000 (15:07 -0700)]
cmd/go: accept more safe CFLAGS/LDFLAGS

Fixes #23749
Fixes #24703
Fixes #24858

Change-Id: Ib32d8efee294004c70fdd602087df2da0867f099
Reviewed-on: https://go-review.googlesource.com/115415
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agonet/http: use DialWithConn method of socks.Dialer
Mikio Hara [Sat, 28 Apr 2018 03:27:53 +0000 (12:27 +0900)]
net/http: use DialWithConn method of socks.Dialer

This change uses the DialWithConn method of socks.Dialer to ensure that
the bundled SOCKS client implementation is agnostic to the behavior and
capabilities of transport connections.

Also updates the bundled golang.org/x/net/internal/socks at git rev
7594486. (golang.org/cl/110135)

Updates #25104.

Change-Id: I87c2e99eeb857f182ea5d8ef569181d4f45f2e5d
Reviewed-on: https://go-review.googlesource.com/110136
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>