]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
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>
6 years agoos/exec: gofmt
Tobias Klauser [Wed, 30 May 2018 19:54:36 +0000 (21:54 +0200)]
os/exec: gofmt

CL 109361 introduced some changes which were not properly gofmt'ed.
Because the CL was sent via Github no gofmt checks were performed
on it (cf. #24946, #18548).

Change-Id: I207065f01161044c420e272f4fd112e0a59be259
Reviewed-on: https://go-review.googlesource.com/115356
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agostrconv: simplify (*extFloat).Normalize
Ilya Tocar [Tue, 15 May 2018 18:29:18 +0000 (13:29 -0500)]
strconv: simplify (*extFloat).Normalize

Use math/bits.LeadingZeros64 instead of local implementation.
This simplifies code, makes Normalize inlinable and fixes performance regression.
Idea was suggested by Giovanni Bajo in #25298

Performance results below:
Atof64Decimal-6                          46.7ns ± 0%  46.7ns ± 0%     ~     (all equal)
Atof64Float-6                            57.9ns ± 1%  56.9ns ± 0%   -1.72%  (p=0.000 n=10+9)
Atof64FloatExp-6                          163ns ± 0%   123ns ± 0%  -24.54%  (p=0.002 n=8+10)
Atof64Big-6                               222ns ± 1%   185ns ± 1%  -16.65%  (p=0.000 n=9+10)
Atof64RandomBits-6                        155ns ± 2%   154ns ± 3%     ~     (p=0.225 n=10+10)
Atof64RandomFloats-6                      156ns ± 2%   154ns ± 2%     ~     (p=0.124 n=10+9)
Atof32Decimal-6                          47.3ns ± 0%  46.7ns ± 0%   -1.26%  (p=0.000 n=7+9)
Atof32Float-6                            51.5ns ± 1%  51.6ns ± 1%     ~     (p=0.455 n=10+9)
Atof32FloatExp-6                          163ns ± 1%   124ns ± 1%  -24.36%  (p=0.000 n=10+10)
Atof32Random-6                            199ns ± 1%   163ns ± 0%  -17.93%  (p=0.000 n=10+10)
FormatFloat/Decimal-6                     209ns ± 2%   211ns ± 2%     ~     (p=0.402 n=10+10)
FormatFloat/Float-6                       393ns ± 2%   379ns ± 1%   -3.57%  (p=0.000 n=10+10)
FormatFloat/Exp-6                         333ns ± 2%   321ns ± 1%   -3.56%  (p=0.000 n=10+9)
FormatFloat/NegExp-6                      338ns ± 3%   317ns ± 1%   -6.27%  (p=0.000 n=10+9)
FormatFloat/Big-6                         457ns ± 1%   443ns ± 2%   -2.99%  (p=0.000 n=9+10)
FormatFloat/BinaryExp-6                   230ns ± 2%   232ns ± 2%     ~     (p=0.070 n=10+10)
FormatFloat/32Integer-6                   209ns ± 2%   211ns ± 1%     ~     (p=0.203 n=10+8)
FormatFloat/32ExactFraction-6             330ns ± 2%   319ns ± 1%   -3.42%  (p=0.000 n=10+10)
FormatFloat/32Point-6                     393ns ± 2%   377ns ± 1%   -4.15%  (p=0.000 n=10+10)
FormatFloat/32Exp-6                       331ns ± 2%   318ns ± 2%   -4.02%  (p=0.000 n=10+10)
FormatFloat/32NegExp-6                    327ns ± 2%   315ns ± 2%   -3.70%  (p=0.000 n=10+10)
FormatFloat/64Fixed1-6                    265ns ± 2%   253ns ± 2%   -4.38%  (p=0.000 n=10+10)
FormatFloat/64Fixed2-6                    278ns ± 2%   262ns ± 3%   -5.71%  (p=0.000 n=10+10)
FormatFloat/64Fixed3-6                    271ns ± 2%   260ns ± 2%   -4.03%  (p=0.000 n=10+10)
FormatFloat/64Fixed4-6                    277ns ± 3%   267ns ± 1%   -3.55%  (p=0.000 n=10+9)
FormatFloat/Slowpath64-6                 71.0µs ± 0%  71.0µs ± 0%     ~     (p=0.744 n=10+8)
AppendFloat/Decimal-6                     100ns ± 1%   100ns ± 0%     ~     (p=0.294 n=10+8)
AppendFloat/Float-6                       273ns ± 0%   260ns ± 1%   -4.87%  (p=0.000 n=7+10)
AppendFloat/Exp-6                         213ns ± 0%   200ns ± 0%   -6.29%  (p=0.000 n=8+10)
AppendFloat/NegExp-6                      211ns ± 0%   198ns ± 0%   -6.16%  (p=0.000 n=8+8)
AppendFloat/Big-6                         319ns ± 0%   305ns ± 0%   -4.31%  (p=0.000 n=8+7)
AppendFloat/BinaryExp-6                  98.4ns ± 0%  92.9ns ± 0%   -5.63%  (p=0.000 n=9+8)
AppendFloat/32Integer-6                   101ns ± 1%   102ns ± 1%   +0.89%  (p=0.004 n=10+10)
AppendFloat/32ExactFraction-6             222ns ± 1%   210ns ± 0%   -5.28%  (p=0.000 n=10+9)
AppendFloat/32Point-6                     273ns ± 1%   261ns ± 1%   -4.62%  (p=0.000 n=10+9)
AppendFloat/32Exp-6                       209ns ± 1%   197ns ± 0%   -5.56%  (p=0.000 n=10+9)
AppendFloat/32NegExp-6                    207ns ± 1%   194ns ± 1%   -6.18%  (p=0.000 n=10+10)
AppendFloat/64Fixed1-6                    145ns ± 0%   131ns ± 1%   -9.93%  (p=0.000 n=9+10)
AppendFloat/64Fixed2-6                    160ns ± 0%   146ns ± 0%   -8.58%  (p=0.000 n=10+8)
AppendFloat/64Fixed3-6                    147ns ± 1%   132ns ± 1%  -10.25%  (p=0.000 n=10+10)
AppendFloat/64Fixed4-6                    161ns ± 1%   149ns ± 0%   -7.93%  (p=0.000 n=10+10)
AppendFloat/Slowpath64-6                 70.6µs ± 1%  70.9µs ± 0%   +0.37%  (p=0.000 n=10+8)

Change-Id: I63bbc40905abd795fbd24743604c790023d11a43
Reviewed-on: https://go-review.googlesource.com/113256
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
6 years agonet: fix leftover variable names from CL 115175
Audrius Butkevicius [Wed, 30 May 2018 19:07:41 +0000 (20:07 +0100)]
net: fix leftover variable names from CL 115175

Change-Id: I5f78fe3286bf4667b6922c57c5701c09bf56e182
Reviewed-on: https://go-review.googlesource.com/115355
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agogo/types: fix typo causing loss of embedded interfaces
Alan Donovan [Fri, 25 May 2018 19:58:37 +0000 (15:58 -0400)]
go/types: fix typo causing loss of embedded interfaces

Simplified the code per prior suggestion to avoid that
kind of error in the first place.

Also: Fix subtle error in Interface.Complete where an
interface may have ended up incomplete if both the list
of methods and the list of embedded interfaces was nil.

Expanded existing test to cover all these cases.

Fixes golang/go#25577

Change-Id: If8723a8b0c4570f02b3dadfa390f96dd98ce11c8
Reviewed-on: https://go-review.googlesource.com/114504
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
6 years agocmd/go: add minimal module-awareness for legacy operation
Russ Cox [Wed, 25 Apr 2018 15:06:41 +0000 (11:06 -0400)]
cmd/go: add minimal module-awareness for legacy operation

We want authors to be able to publish code that works with both
the current standard go command and the planned new go command
support for modules. If authors have tagged their code v2 or later,
semantic import versioning means the import paths must include a
v2 path element after the path prefix naming the module.
One option for making this convention compatible with original go get
is to move code into a v2 subdirectory of the root.
That makes sense for some authors, but many authors would prefer
not to move all the code into a v2 subdirectory for a transition and
then move it back up once we everyone has a module-aware go command.

Instead, this CL teaches the old (non-module-aware) go command
a tiny amount about modules and their import paths, to expand
the options for authors who want to publish compatible packages.
If an author has a v2 of a package, say my/thing/v2/sub/pkg,
in the my/thing repo's sub/pkg subdirectory (no v2 in the file system path),
then old go get continues to import that package as my/thing/sub/pkg.
But when go get is processing code in any module (code in a tree with
a go.mod file) and encounters a path like my/thing/v2/sub/pkg,
it will check to see if my/thing/go.mod says "module my/thing/v2".
If so, the go command will read the import my/thing/v2/sub/pkg
as if it said my/thing/sub/pkg, which is the correct "old" import path
for the package in question.

This CL will be back-ported to Go 1.10 and Go 1.9 as well.

Once users have updated to the latest Go point releases containing
this new logic, authors will be able to update to using modules
within their own repos, including using semantic import paths
with vN path elements, and old go get will still be able to consume
those repositories.

This CL also makes "go get" ignore meta go-import lines using
the new "mod" VCS type. This allows a package to specify both
a "mod" type and a "git" type, to present more efficient module
access to module-aware go but still present a Git repo to the old
"go get".

Fixes #24751.
Fixes #25069.

Change-Id: I378955613a0d63834d4f50f121f4db7e4d87dc0a
Reviewed-on: https://go-review.googlesource.com/109340
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
6 years agonet/http/httputil: reduced log verbosity in reverseproxy_test.go
teague [Wed, 30 May 2018 15:35:11 +0000 (11:35 -0400)]
net/http/httputil: reduced log verbosity in reverseproxy_test.go

For functions TestClonesRequestHeaders and TestReverseProxy_PanicBodyError,
I made changes to update the log verbosity.

Fixes #25634

Change-Id: I2a0ef70a8191cfb1a0005949345be722fb4ab62e
Reviewed-on: https://go-review.googlesource.com/115296
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: add js/wasm compatible DefaultTransport
Johan Brandhorst [Wed, 30 May 2018 17:11:31 +0000 (17:11 +0000)]
net/http: add js/wasm compatible DefaultTransport

Adds a new Transport type for the js/wasm target that uses the
JavaScript Fetch API for sending HTTP requests. Support for
streaming response bodies is used when available, falling back
to reading the entire response into memory at once.

Updates #25506

Change-Id: Ie9ea433a1a2ed2f65b03c6cc84a16e70c06fcf5c
GitHub-Last-Rev: 6df646745b8e0474781f4b1a3084536e573e8e8c
GitHub-Pull-Request: golang/go#25550
Reviewed-on: https://go-review.googlesource.com/114515
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/compile: do not allow regalloc to LoadReg G register
David Chase [Fri, 25 May 2018 20:08:13 +0000 (16:08 -0400)]
cmd/compile: do not allow regalloc to LoadReg G register

On architectures where G is stored in a register, it is
possible for a variable to allocated to it, and subsequently
that variable may be spilled and reloaded, for example
because of an intervening call.  If such an allocation
reaches a join point and it is the primary predecessor,
it becomes the target of a reload, which is only usually
right.

Fix: guard all the LoadReg ops, and spill value in the G
register (if any) before merges (in the same way that 387
FP registers are freed between blocks).

Includes test.

Fixes #25504.

Change-Id: I0482a53e20970c7315bf09c0e407ae5bba2fe05d
Reviewed-on: https://go-review.googlesource.com/114695
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
6 years agocmd/vendor/.../pprof: sync at rev 1ddc9e2
Hana Kim [Wed, 30 May 2018 14:54:20 +0000 (10:54 -0400)]
cmd/vendor/.../pprof: sync at rev 1ddc9e2

This includes changes in pprof to support
 - the new -diff_base flag
 - fix for a bug in handling of legacy Go heap profiles

Update #25096

Change-Id: I826ac9244f31cc2c4415388c44a0cbe77303e460
Reviewed-on: https://go-review.googlesource.com/115295
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/dist: remove external linking check for macOS 10.6
Tobias Klauser [Wed, 30 May 2018 14:55:26 +0000 (16:55 +0200)]
cmd/dist: remove external linking check for macOS 10.6

This was missed in CL 115236.

Updates #23122

Change-Id: I5a64bd02d356c21c0e5d02dafafb3721f8dd8e06
Reviewed-on: https://go-review.googlesource.com/115276
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agomath/big: implement Atkin's ModSqrt for 5 mod 8 primes
Brian Kessler [Wed, 6 Dec 2017 16:53:14 +0000 (09:53 -0700)]
math/big: implement Atkin's ModSqrt for 5 mod 8 primes

For primes congruent to 5 mod 8 there is a simple deterministic
method for calculating the modular square root due to Atkin,
using one exponentiation and 4 multiplications.

A. Atkin.  Probabilistic primality testing, summary by F. Morain.
Research Report 1779, INRIA, pages 159–163, 1992.

This increases the speed of modular square roots for these primes
considerably.

name                old time/op  new time/op  delta
ModSqrt231_5Mod8-4  1.03ms ± 2%  0.36ms ± 5%  -65.06%  (p=0.008 n=5+5)

Change-Id: I024f6e514bbca8d634218983117db2afffe615fe
Reviewed-on: https://go-review.googlesource.com/99615
Reviewed-by: Robert Griesemer <gri@golang.org>
6 years agogo/types: don't over-eagerly verify embedded interfaces
Robert Griesemer [Tue, 29 May 2018 22:13:32 +0000 (15:13 -0700)]
go/types: don't over-eagerly verify embedded interfaces

In https://go-review.googlesource.com/c/go/+/114317 (fix for #25301)
the constructor types.NewInterface was replaced with NewInterface2.
The new constructor aggressively verified that embedded interfaces
had an underlying type of interface type; the old code didn't do
any verification. During importing, defined types may be not yet
fully set up, and testing their underlying types will fail in those
cases.

This change only verifies embedded types that are not defined types
and thus restores behavior for defined types to how it was before
the fix for #25301.

Fixes #25596.
Fixes #25615.

Change-Id: Ifd694413656ec0b780fe4f37acaa9e6ba6077271
Reviewed-on: https://go-review.googlesource.com/115155
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
6 years agocmd/link/internal/ld: drop duplicate copyright comment
Tobias Klauser [Wed, 30 May 2018 07:52:06 +0000 (09:52 +0200)]
cmd/link/internal/ld: drop duplicate copyright comment

The copyright message already appears at the top of macho.go. Drop the
duplicate further down in the file.

Change-Id: Ib0a69f568c4ef656bab14176223936cd2fe078d1
Reviewed-on: https://go-review.googlesource.com/115235
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/dist: remove support for macOS 10.9 and earlier
Tobias Klauser [Wed, 30 May 2018 08:10:08 +0000 (10:10 +0200)]
cmd/dist: remove support for macOS 10.9 and earlier

Updates #23122

Change-Id: I14cfb83f3f78cdbe5880bd29209388ad12b9ee89
Reviewed-on: https://go-review.googlesource.com/115236
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agonet/http: fix typo in comment
Tobias Klauser [Wed, 30 May 2018 08:15:56 +0000 (10:15 +0200)]
net/http: fix typo in comment

Change-Id: Ibb21c12bf67b2648eb7606bee8ec1b54e6c70dd5
Reviewed-on: https://go-review.googlesource.com/115237
Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com>
6 years agonet: fix ExampleUDPConn_WriteTo
Mikio Hara [Wed, 30 May 2018 03:52:49 +0000 (12:52 +0900)]
net: fix ExampleUDPConn_WriteTo

Change-Id: I174b17395509d4c9fb55332c2405890b2a350cbd
Reviewed-on: https://go-review.googlesource.com/115218
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agonet: move dial and listen functions under sysDialer, sysListener
Audrius Butkevicius [Tue, 29 May 2018 22:53:19 +0000 (23:53 +0100)]
net: move dial and listen functions under sysDialer, sysListener

Updates #9661

Change-Id: I237e7502cb9faad6dece1e25b1a503739c54d826
Reviewed-on: https://go-review.googlesource.com/115175
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agonet/http: document Server's implicit Content-Length response header
Brad Fitzpatrick [Tue, 29 May 2018 20:05:12 +0000 (20:05 +0000)]
net/http: document Server's implicit Content-Length response header

Fixes #23450

Change-Id: I829399194299d2e6d5e754b60e8f72b321b5da90
Reviewed-on: https://go-review.googlesource.com/115040
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agonet/http/httputil: pass through any "TE: trailers" header to backend
Brad Fitzpatrick [Tue, 29 May 2018 22:08:32 +0000 (22:08 +0000)]
net/http/httputil: pass through any "TE: trailers" header to backend

Fixes #21096

Change-Id: I2a4688a79bdaa25b4e8ef38e3390d93d3d0bce04
Reviewed-on: https://go-review.googlesource.com/115135
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoruntime: implement time.now using libc
Keith Randall [Sat, 26 May 2018 16:58:26 +0000 (09:58 -0700)]
runtime: implement time.now using libc

Change-Id: Ibdd9202d9711ea8aab2446c9950ddb8e1f6bf4e0
Reviewed-on: https://go-review.googlesource.com/114799
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocontext: add benchmarks for context cancellation
Carl Mastrangelo [Thu, 15 Mar 2018 21:15:54 +0000 (14:15 -0700)]
context: add benchmarks for context cancellation

Change-Id: I539c9226eb7e493b52c50e1e431954567d43bcfb
Reviewed-on: https://go-review.googlesource.com/100847
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agonet/http: vendor x/net/http/httpproxy, use it in net/http
Roger Peppe [Wed, 4 Oct 2017 18:28:59 +0000 (19:28 +0100)]
net/http: vendor x/net/http/httpproxy, use it in net/http

From x/net git rev c7086645de2.

Updates #16704

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

6 years agogo/types: add struct field with invalid type if field has errors
Robert Griesemer [Tue, 29 May 2018 20:13:24 +0000 (13:13 -0700)]
go/types: add struct field with invalid type if field has errors

This ensures that all struct fields are present and thus the struct
has the original number of fields even if some fields have type
errors. (This only applies as long as the field names themselves
don't conflict.)

Fixes #25627.

Change-Id: I2414b1f432ce139b3cd2776ff0d46d8dcf38b650
Reviewed-on: https://go-review.googlesource.com/115115
Reviewed-by: Alan Donovan <adonovan@google.com>
6 years agoos/signal: remove unnecessary else condition
Tim Cooper [Sat, 21 Apr 2018 11:20:39 +0000 (08:20 -0300)]
os/signal: remove unnecessary else condition

Change-Id: I00f0195d54bf9bc30073741974ab941ec4d51a5c
Reviewed-on: https://go-review.googlesource.com/108635
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoall: regenerate stringer files
Tim Cooper [Tue, 29 May 2018 20:29:31 +0000 (17:29 -0300)]
all: regenerate stringer files

Change-Id: I34838320047792c4719837591e848b87ccb7f5ab
Reviewed-on: https://go-review.googlesource.com/115058
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agonet/http: document how Hijack and Request.Context interact
Brad Fitzpatrick [Tue, 29 May 2018 19:45:34 +0000 (19:45 +0000)]
net/http: document how Hijack and Request.Context interact

Fixes #22347

Change-Id: If86aa5d54cfd7a7c32d630fb2bf4f47e057dbfb2
Reviewed-on: https://go-review.googlesource.com/115039
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoall: remove support for macOS 10.9 and earlier
Brad Fitzpatrick [Tue, 29 May 2018 18:57:44 +0000 (18:57 +0000)]
all: remove support for macOS 10.9 and earlier

Updates #23122

Change-Id: I4c12ec5cb1a1f15d7858f3deab636710c0660e26
Reviewed-on: https://go-review.googlesource.com/115038
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agobytes: re-slice buffer to its previous length after call to grow()
Dave Russell [Sat, 19 May 2018 00:54:43 +0000 (00:54 +0000)]
bytes: re-slice buffer to its previous length after call to grow()

Fixes #25435

The added test fails without the re-slice and passes with it.

Change-Id: I5ebc2a737285eb116ecc5938d8bf49050652830f
GitHub-Last-Rev: 454ddad7df8d56a1d0e05a999ed8277c5516ce01
GitHub-Pull-Request: golang/go#25436
Reviewed-on: https://go-review.googlesource.com/113495
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agoruntime: wrap darwin libc calls to keep profiler happy
Keith Randall [Sat, 26 May 2018 18:29:55 +0000 (11:29 -0700)]
runtime: wrap darwin libc calls to keep profiler happy

The profiler reports "ExternalCode" when a profiler interrupt happens
while in libc code. Instead, keep track of the most recent Go frame
for the profiler to use.

There is a test for this using time.Now (runtime.TestTimePprof),
which will work once time.Now is moved to using libc (my next CL).

Change-Id: I940ea83edada482a482e2ab103d3a65589979464
Reviewed-on: https://go-review.googlesource.com/114798
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/compile: update WBLoads during deadcode
Keith Randall [Tue, 29 May 2018 17:30:54 +0000 (10:30 -0700)]
cmd/compile: update WBLoads during deadcode

When we deadcode-remove a block which is a write barrier test,
remove that block from the list of write barrier test blocks.

Fixes #25516

Change-Id: I1efe732d5476003eab4ad6bf67d0340d7874ff0c
Reviewed-on: https://go-review.googlesource.com/115037
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agocmd/go: whitelist -v as a compiler and linker flag
Daniel Martí [Tue, 29 May 2018 15:10:39 +0000 (17:10 +0200)]
cmd/go: whitelist -v as a compiler and linker flag

It's harmless, and can be useful to see what's happening under the hood.

Fixes #24593.

Change-Id: Iacff378471e86c33aa048161cd65c504709fb339
Reviewed-on: https://go-review.googlesource.com/115075
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoreflect: document that StructOf panics on unexported fields
Alberto Donizetti [Tue, 29 May 2018 12:36:28 +0000 (14:36 +0200)]
reflect: document that StructOf panics on unexported fields

Fixes #25401

Change-Id: I0b61ecfcee43ebfe0a84b5c1e28a3817f96b94ed
Reviewed-on: https://go-review.googlesource.com/115015
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/vet: avoid false positives with non-comments
Daniel Martí [Fri, 4 May 2018 04:22:53 +0000 (11:22 +0700)]
cmd/vet: avoid false positives with non-comments

vet's buildtag check looks for malformed build tag comments. Since these
can appear in Go files as well as non-Go files (such as assembly files),
it must read the file line by line instead of using go/token or go/ast
directly.

However, this method runs into false positives if there are any lines in
the code that look like comments, but are not. For example:

$ cat f.go
package main
const foo = `
//+build ignore
`
$ go vet f.go
./f.go:3: +build comment must appear before package clause and be followed by a blank line

This bug has been popping up more frequently since vet started being run
with go test, so it is important to make the check as precise as
possible.

To avoid the false positive, when checking a Go file, cross-check that a
line that looks like a comment actually corresponds to a comment in the
go/ast syntax tree. Since vet already obtains the syntax trees for all
the Go files, it checks, this change means very little extra work for
the check.

While at it, add a badf helper function to simplify the code that
reports warnings in the buildtag check.

Fixes #13533.

Change-Id: I484a16da01363b409ec418c313634171bf85250b
Reviewed-on: https://go-review.googlesource.com/111415
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/compile: reject large argument areas
Keith Randall [Tue, 29 May 2018 16:30:12 +0000 (09:30 -0700)]
cmd/compile: reject large argument areas

Extend stack frame limit of 1GB to include large argument/return areas.
Argument/return areas are part of the parent frame, not the frame itself,
so they need to be handled separately.

Fixes #25507.

Change-Id: I309298a58faee3e7c1dac80bd2f1166c82460087
Reviewed-on: https://go-review.googlesource.com/115036
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/cgo: use standard generated code comment
Ian Lance Taylor [Tue, 29 May 2018 13:40:56 +0000 (06:40 -0700)]
cmd/cgo: use standard generated code comment

Change cgo to follow https://golang.org/s/generatedcode.

For the C code we continue to use /* */ comments, so they don't follow
the format exactly. It doesn't really matter since the format is only
for Go code anyhow. This CL changes the C code to be similar for
consistency.

Fixes #25623

Change-Id: Idcfee53ec4069924d173ab8cedeb7bcfb7312863
Reviewed-on: https://go-review.googlesource.com/115035
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
6 years agoruntime: fix typo in comment for cpuinit
Tobias Klauser [Tue, 29 May 2018 07:08:42 +0000 (09:08 +0200)]
runtime: fix typo in comment for cpuinit

Change-Id: Ie19e0354f813b042c995c0221072568eaa473bea
Reviewed-on: https://go-review.googlesource.com/114995
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoindex/suffixarray: fix a typo mistake in comments
Zhou Peng [Tue, 29 May 2018 08:56:42 +0000 (08:56 +0000)]
index/suffixarray: fix a typo mistake in comments

Change-Id: Ibdd1ca7bfc6fb2419621338f1f8e37c876ba89c0
Reviewed-on: https://go-review.googlesource.com/114976
Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com>
6 years agoimage: add an example that shows how to get the metadata of an image
Aarti Parikh [Tue, 29 May 2018 00:42:10 +0000 (00:42 +0000)]
image: add an example that shows how to get the metadata of an image

This is a simple but everyday use case in image libraries. Currently,
there is one example in this library and it is lengthy and involved.

This PR will be imported into Gerrit with the title and first
comment (this text) used to generate the subject and body of
the Gerrit change.

Change-Id: Idca527d97c095af88755446e1548fa2b8ace7eb0
GitHub-Last-Rev: f5743c8ef337a8b7a5126db21d784593f4f53c8a
GitHub-Pull-Request: golang/go#25616
Reviewed-on: https://go-review.googlesource.com/114939
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/compile: fix trivial typos in comments
Josh Bleecher Snyder [Mon, 28 May 2018 20:49:40 +0000 (13:49 -0700)]
cmd/compile: fix trivial typos in comments

Change-Id: I04880d87e317a1140ec12da6ec5e788991719760
Reviewed-on: https://go-review.googlesource.com/114936
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agotest: gofmt bounds.go
Josh Bleecher Snyder [Mon, 28 May 2018 22:29:01 +0000 (15:29 -0700)]
test: gofmt bounds.go

Change-Id: I8b462e20064658120afc8eb1cbac926254d1e24e
Reviewed-on: https://go-review.googlesource.com/114937
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/dist: report correct CC name in error about missing CC
Ian Lance Taylor [Mon, 28 May 2018 18:36:29 +0000 (11:36 -0700)]
cmd/dist: report correct CC name in error about missing CC

Fixes #25611

Change-Id: I487463584e4d9d99cf5d8db0c9a4b4e66464ecd8
Reviewed-on: https://go-review.googlesource.com/114935
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocrypto: fix typos in the comments
Alexander F Rødseth [Mon, 28 May 2018 10:40:54 +0000 (10:40 +0000)]
crypto: fix typos in the comments

* Fix typos in the comments in the assembly code for the crypto package.

Change-Id: Iac146a7d8bee4a680a8d4d3af533fbc1b259482d
GitHub-Last-Rev: 65090a38956df4c14bf55df4881c76e8c3d32447
GitHub-Pull-Request: golang/go#25606
Reviewed-on: https://go-review.googlesource.com/114803
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/vet: eliminate use of Perl in tests
Yury Smolsky [Tue, 22 May 2018 19:37:40 +0000 (22:37 +0300)]
cmd/vet: eliminate use of Perl in tests

This change uses errorCheck and wantedErrors functions copied from
the test/run.go to eliminate use of the test/errchk perl script.

Tests' error messages that contained full filenames were changed to
have base filenames because the errorCheck function processes output
from "go vet" in the same way.

Fixes #20032.

Change-Id: Ieb7be67c2d7281b9648171c698398449b7e2d4dd
Reviewed-on: https://go-review.googlesource.com/114176
Run-TryBot: Yury Smolsky <yury@smolsky.by>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
6 years agocmd/cover: fix sorting of profile segment boundaries
David Symonds [Mon, 28 May 2018 03:03:08 +0000 (13:03 +1000)]
cmd/cover: fix sorting of profile segment boundaries

If a span of coverable code is empty (e.g. an empty select clause)
then there will be two Boundary values with the same offset. In that
case, the starting Boundary needs to come first so that the generated
HTML output will open the <span> tag before it tries to close it.

Change-Id: Ib44a8b7c36ae57757c18b6cceb7a88ffa4e95394
Reviewed-on: https://go-review.googlesource.com/114855
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>