1
0
mirror of https://github.com/golang/go synced 2024-09-30 00:14:36 -06:00
Commit Graph

40967 Commits

Author SHA1 Message Date
Emmanuel T Odeke
e764432605 doc/go1.13: document _ between digits for math/big, strconv
Document that:
* math/big.Float.Parse
* math/big.Int.SetString
* strconv.ParseFloat
* strconv.ParseInt
* strconv.ParseUint
now accept underscores to group digits only if base = 0,
as per the Go 2 language changes.

Updates #32815

Change-Id: Id45bd803a18442436419739297e8aed0d32ca56c
Reviewed-on: https://go-review.googlesource.com/c/go/+/191077
Reviewed-by: Robert Griesemer <gri@golang.org>
2019-08-21 18:39:21 +00:00
Filippo Valsorda
eee07a8e68 Revert "encoding/json: avoid work when unquoting strings"
This reverts CL 151157.

CL 151157 introduced a crash when decoding into ",string" fields. It
came with a moderate speedup, so at this stage of the release cycle
let's just revert it, and reapply it in Go 1.14 with the fix in CL 190659.

Also applied the test cases from CL 190659.

Updates #33728

Change-Id: Ie46e2bc15224b251888580daf6b79d5865f3878e
Reviewed-on: https://go-review.googlesource.com/c/go/+/190909
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-08-21 15:20:00 +00:00
Russ Cox
c61c29fe56 cmd/go: accept GOSUMDB=sum.golang.google.cn
This CL makes the go command understand that
GOSUMDB=sum.golang.google.cn should connect
to that domain but expect to find a checksum database
signed by sum.golang.org there.

The host sum.golang.google.cn is not yet completely
configured; we hope it will be available in a few weeks.

Change-Id: Ie0fc4323f0c7084dda59bd3b45fc406717fa16d9
Reviewed-on: https://go-review.googlesource.com/c/go/+/191137
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-08-21 15:13:03 +00:00
Bryan C. Mills
723852388e doc/go1.13: mention '-o <directory>' support for 'go build'
Fixes #33720
Updates #14295

Change-Id: I9cb6e02bcaccd7971057315163d8810157d465bd
Reviewed-on: https://go-review.googlesource.com/c/go/+/190907
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2019-08-20 21:00:50 +00:00
Filippo Valsorda
53c088fbf0 cmd/go: fix "go help build -o" docs
The docs refer to "the last two paragraphs", but in fact should refer to
the first two of the previous three paragraphs. Moved up the out of place
paragraph.

Updates #14295

Change-Id: I066da7a665bc6754d246782b941af214a385017a
Reviewed-on: https://go-review.googlesource.com/c/go/+/190839
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-08-20 19:26:11 +00:00
Wagner Riffel
d6ffc1d839 doc: rewrite reference to plan9.bell-labs.com to 9p.io
Change-Id: I75619feced842b8ca509ee08e01b63258c5e87ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/190757
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-08-19 21:42:54 +00:00
Dmitry Vyukov
0dd120df7e encoding/json: fix format string in the Fuzz func
Currently test build fails with:

$ go test -tags=gofuzz encoding/json
encoding/json/fuzz.go:36:4: Println call has possible formatting directive %s
FAIL	encoding/json [build failed]

Change-Id: I23aef44a421ed0e7bcf48b74ac5a8c6768a4841b
Reviewed-on: https://go-review.googlesource.com/c/go/+/190698
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-08-18 01:16:33 +00:00
Joe Tsai
c485506b0a time: update TestSub to avoid future regressions
CL 131196 optimized Time.Sub, but was reverted because
it incorrectly computed the nanoseconds in some edge cases.
This CL adds a test case to enforce the correct behavior
so that a future optimization does not break this again.

Updates #17858
Updates #33677

Change-Id: I596d8302ca6bf721cf7ca11cc6f939639fcbdd43
Reviewed-on: https://go-review.googlesource.com/c/go/+/190524
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-08-16 19:54:57 +00:00
Joe Tsai
bb5441de48 cmd/gofmt: update TestRewrite to avoid future regressions
CL 162337 changed go/ast to better handle block comments,
but was reverted because it introduced an off-by-one bug.
This CL adds a test case to enforce the correct behavior
so that future changes do not break this again.

Updates #18929
Updates #33538

Change-Id: I2d25c139d007f8db1091b7a48b1dd20c584e2699
Reviewed-on: https://go-review.googlesource.com/c/go/+/190523
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2019-08-16 19:54:55 +00:00
Joe Tsai
4983a0b75b Revert "time: optimize Sub"
This reverts commit CL 131196 because there is a bug
in the calculation of nanoseconds.

Fixes #33677

Change-Id: Ic8e94c547ee29b8aeda1b9a5cb9764dbf47b14b4
Reviewed-on: https://go-review.googlesource.com/c/go/+/190497
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-08-16 17:01:35 +00:00
Dmitri Shuralyov
0212f0410f doc: document Go 1.12.9
Change-Id: I88b7e085fc70f9c021788d364099f5bc6b705ba8
Reviewed-on: https://go-review.googlesource.com/c/go/+/190438
Reviewed-by: Filippo Valsorda <filippo@golang.org>
2019-08-15 17:49:11 +00:00
Dmitri Shuralyov
395fd106bc doc: document Go 1.12.8 and Go 1.11.13
Change-Id: I0daab6cd347e1fc0066e516f02c33f1b63e3f1a3
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/526992
Reviewed-by: Filippo Valsorda <valsorda@google.com>
(cherry picked from commit 305f6dc30c)
Reviewed-on: https://go-review.googlesource.com/c/go/+/190437
Reviewed-by: Filippo Valsorda <filippo@golang.org>
2019-08-15 17:42:40 +00:00
Cherry Zhang
5f45a3337e reflect: align first argument in callMethod
When calling a function obtained from reflect.Value.Method (or
MethodByName), we copy the arguments from the caller frame, which
does not include the receiver, to a new frame to call the actual
method, which does include the receiver. Here we need to align
the first (non-receiver) argument. As the receiver is pointer
sized, it is generally naturally aligned, except on amd64p32,
where the argument can have larger alignment, and this aligning
becomes necessary.

Fixes #33628.

Change-Id: I5bea0e20173f06d1602c5666d4f334e3d0de5c1e
Reviewed-on: https://go-review.googlesource.com/c/go/+/190297
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2019-08-14 19:49:15 +00:00
Toshihiro Shiino
ad4ed87f80 doc/go1.13: add missing periods
Change-Id: If9ad650174572c475f0b3d3394208c2a9dd0a596
Reviewed-on: https://go-review.googlesource.com/c/go/+/190237
Reviewed-by: Agniva De Sarker <agniva.quicksilver@gmail.com>
2019-08-14 11:43:16 +00:00
Filippo Valsorda
61bb56ad63 net/url: make Hostname and Port predictable for invalid Host values
When Host is not valid per RFC 3986, the behavior of Hostname and Port
was wildly unpredictable, to the point that Host could have a suffix
that didn't appear in neither Hostname nor Port.

This is a security issue when applications are applying checks to Host
and expecting them to be meaningful for the contents of Hostname.

To reduce disruption, this change only aims to guarantee the following
two security-relevant invariants.

* Host is either Hostname or [Hostname] with Port empty, or
  Hostname:Port or [Hostname]:Port.

* Port is only decimals.

The second invariant is the one that's most likely to cause disruption,
but I believe it's important, as it's conceivable an application might
do a suffix check on Host and expect it to be meaningful for the
contents of Hostname (if the suffix is not a valid port).

There are three ways to ensure it.

1) Reject invalid ports in Parse. Note that non-numeric ports are
   already rejected if and only if the host starts with "[".

2) Consider non-numeric ports as part of Hostname, not Port.

3) Allow non-numeric ports, and hope they only flow down to net/http,
   which will reject them (#14353).

This change adopts both 1 and 2. We could do only the latter, but then
these invalid hosts would flow past port checks, like in
http_test.TestTransportRejectsAlphaPort. Non-numeric ports weren't fully
supported anyway, because they were rejected after IPv6 literals, so
this restores consistency. We could do only the former, but at this
point 2) is free and might help with manually constructed Host values
(or if we get something wrong in Parse).

Note that net.SplitHostPort and net.Dial explicitly accept service names
in place of port numbers, but this is an URL package, and RFC 3986,
Section 3.2.3, clearly specifies ports as a number in decimal.

net/http uses a mix of net.SplitHostPort and url.Parse that would
deserve looking into, but in general it seems that it will still accept
service names in Addr fields as they are passed to net.Listen, while
rejecting them in URLs, which feels correct.

This leaves a number of invalid URLs to reject, which however are not
security relevant once the two invariants above hold, so can be done in
Go 1.14: IPv6 literals without brackets (#31024), invalid IPv6 literals,
hostnames with invalid characters, and more.

Tested with 200M executions of go-fuzz and the following Fuzz function.

	u, err := url.Parse(string(data))
	if err != nil {
		return 0
	}
	h := u.Hostname()
	p := u.Port()

	switch u.Host {
	case h + ":" + p:
		return 1
	case "[" + h + "]:" + p:
		return 1
	case h:
		fallthrough
	case "[" + h + "]":
		if p != "" {
			panic("unexpected Port()")
		}
		return 1
	}
	panic("Host is not a variant of [Hostname]:Port")

Fixes CVE-2019-14809
Updates #29098

Change-Id: I7ef40823dab28f29511329fa2d5a7fb10c3ec895
Reviewed-on: https://go-review.googlesource.com/c/go/+/189258
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-08-12 23:12:29 +00:00
Filippo Valsorda
45504066d7 src/go.mod: sync golang.org/x/net with h2_bundle.go
The bundle included changes from a commit after the one referred to by
the go.mod, probably due to cmd/bundle using the GOPATH source.

Identified with the new go/packages based cmd/bundle from CL 189818.

$ go get golang.org/x/net@461777fb6f
$ go mod tidy
$ go mod vendor
$ go generate net/http # with CL 189818

Also, updated the socks_bundle.go generate command to drop obsolete
options and match h2_bundle.go. It caused no output changes.

Updates #32031

Change-Id: I0322d4e842dbfdad749455111072ca4872a62ad4
Reviewed-on: https://go-review.googlesource.com/c/go/+/189897
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-08-12 20:14:38 +00:00
Ian Lance Taylor
8b058cfbce net: document that a keep-alive failure also returns a timeout
Updates #31449

Change-Id: I76490c5e83eb2f7ba529b387a57ba088428aece5
Reviewed-on: https://go-review.googlesource.com/c/go/+/189757
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
2019-08-11 15:44:08 +00:00
Pure White
2754118731 doc/asm: document go_asm.h only works in the runtime package
Fixes #33054

Change-Id: I687d45e092d721a6c22888cc7ddbe420c16a5af9
GitHub-Last-Rev: a7208c89a0
GitHub-Pull-Request: golang/go#33069
Reviewed-on: https://go-review.googlesource.com/c/go/+/185917
Reviewed-by: Rob Pike <r@golang.org>
2019-08-11 05:38:06 +00:00
Carlo Alberto Ferraris
3928915ec7 doc/go1.13: mention faster sync.Mutex/RWMutex/Once
Mention faster sync.Mutex/RWMutex/Once in the 1.13 release notes.

Change-Id: I29d8a5004a0af42542e8db82a8c9e2e06a15dbb0
GitHub-Last-Rev: 2995401dab
GitHub-Pull-Request: golang/go#33404
Reviewed-on: https://go-review.googlesource.com/c/go/+/188479
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
2019-08-10 20:06:28 +00:00
K. "pestophagous" Heller
9c1f14f376 doc/install-source: create distinction between steps that involve "git clone"
Prior doc implied that "git clone" was one way to obtain a go1.4
bootstrap toochain, but it did not state this outright. Further,
the doc did not make it explicit in the "Fetch the repository"
section that one must necessarily "git clone" a second time in
the (presumed-to-be-uncommon) case where "git clone" had already
been perfomed in the "compiler binaries" section.

Updates #33402

Change-Id: Id70a6587b6ee09aca13559d63868b75cb07dff1e
Reviewed-on: https://go-review.googlesource.com/c/go/+/188900
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-08-09 20:26:42 +00:00
Ian Lance Taylor
951143cf14 cmd/link: increase the function call limit in stkcheck
There is real (albeit generated) code that exceeds the limit.

Fixes #33555

Change-Id: I668e85825d3d2a471970e869abe63f3492213cc1
Reviewed-on: https://go-review.googlesource.com/c/go/+/189697
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2019-08-09 20:22:03 +00:00
Agniva De Sarker
362625209b doc/install-source.html: add new GOOS and GOARCHes
And also insert new paragraphs between GOOS and GOARCH listings
for better readability.

Fixes #28142
Fixes #26513

Change-Id: Ie92e98dbfd924e80032a12afbfa02f30e3a6f916
Reviewed-on: https://go-review.googlesource.com/c/go/+/189578
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-08-09 17:07:27 +00:00
Bryan C. Mills
2b8b34aa30 cmd/go: query each path only once in 'go get'
If we don't know whether a path is a module path or a package path,
previously we would first try a module query for it, then fall back to
a package query.

If we are using a sequence of proxies with fallback (as will be the
default in Go 1.13), and the path is not actually a module path, that
initial module query will fail against the first proxy, then
immediately fall back to the next proxy in the sequence — even if the
query could have been satisfied by some other (prefix) module
available from the first proxy.

Instead, we now query the requested path as only one kind of path.
If we query it as a package path but it turns out to only exist as a
module, we can detect that as a PackageNotInModuleError with an
appropriate module path — we do not need to issue a second query to
classify it.

Fixes #31785

Change-Id: I581d44279196e41d1fed27ec25489e75d62654e3
Reviewed-on: https://go-review.googlesource.com/c/go/+/189517
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2019-08-09 15:52:43 +00:00
Jay Conrod
1dc0110bf7 cmd/go: improve 'go mod download' and 'go list -m' error messages
modload.ListModules now wraps errors as module.ModuleError as
appropriate. The resulting errors always include the module path and
will include the version, if known.

'go mod download' no longer ignores errors reported by ListModules.
Previously, it started requesting module info, go.mod, and zip. Those
requests would fail, overwriting the original failure. They were
usually less descriptive.

'go mod download' with a module not in the build list (and no version
query) is now an error. Previously, this was silently ignored.

Fixes #30743

Change-Id: Icee8c1c6c5240de135a8b6ba42d6bbcdb757cdac
Reviewed-on: https://go-review.googlesource.com/c/go/+/189323
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2019-08-08 20:38:47 +00:00
Joe Tsai
c5178ef69e Revert "go/ast: fix SortImports to handle block comments"
This reverts CL 162337.

Reason for revert: this introduces a regression

Fixes #33538
Updates #18929

Change-Id: Ib2320a840c6d3ec7912e8f414e933d04fbf11ab4
Reviewed-on: https://go-review.googlesource.com/c/go/+/189379
Reviewed-by: Robert Griesemer <gri@golang.org>
2019-08-08 19:18:56 +00:00
Filippo Valsorda
fc23e21631 api/go1.13: add debug/elf.Symbol fields added in CL 184099
These will need auditing per #32813 like a few others in go1.13.txt, but
in the meantime they break the API check for beta/RC releases.

Updates #32813
Updates #31912

Change-Id: I3b0501b46324ee6fc0985f84971b99b772c7e4a4
Reviewed-on: https://go-review.googlesource.com/c/go/+/189458
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-08-08 18:44:16 +00:00
Alberto Donizetti
f4be93a8f1 doc: update list of archs supporting -race
Change-Id: Id0a55674a16671aaee99182d9096a9263f7a80b3
Reviewed-on: https://go-review.googlesource.com/c/go/+/189357
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-08-08 16:16:15 +00:00
Derek Phan
e9782bdebd path: fix mismatch between error message and corresponding test function
Change-Id: Ib0ae6e3e678dc7ace21b891e946ffc6bc2a78835
GitHub-Last-Rev: 8c6704ea8c
GitHub-Pull-Request: golang/go#33534
Reviewed-on: https://go-review.googlesource.com/c/go/+/189378
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-08-08 00:38:10 +00:00
David Finkel
0ca4f6be35 runtime/pprof: Mention goroutine label heritability
Document goroutine label inheritance. Goroutine labels are copied upon
goroutine creation and there is a test enforcing this, but it was not
mentioned in the docstrings for `Do` or `SetGoroutineLabels`.

Add notes to both of those functions' docstrings so it's clear that one
does not need to set labels as soon as a new goroutine is spawned if
they want to propagate tags.

Updates #32223
Updates #23458

Change-Id: Idfa33031af0104b884b03ca855ac82b98500c8b4
Reviewed-on: https://go-review.googlesource.com/c/go/+/189317
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-08-07 14:40:17 +00:00
Jay Conrod
e37a1b1ca6 cmd/go: improve error message for missing import starting with cmd/
In modload.Import, confirm that the import path does not start with
"cmd/" before calling QueryPackage, which returns a less helpful
error.

In load.loadPackageData, don't wrap errors with "unknown import path".
The wrapped error should always include the import path, and it's also
repeated in the PackageError wrapper.

Fixes #31031

Change-Id: I071efa22e3842c62831d096f888a8006811fe724
Reviewed-on: https://go-review.googlesource.com/c/go/+/189157
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2019-08-06 23:05:55 +00:00
Marcel van Lohuizen
0ed86cda67 doc: mention Unicode update in release notes
Fixes #33472

Change-Id: Iab69e69589f2e017f4cf9770858884b1a570c89e
Reviewed-on: https://go-review.googlesource.com/c/go/+/188799
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-08-06 19:12:41 +00:00
Jay Conrod
46f99ce7ea cmd/go: look for __go_buildinfo section when looking for Mach-O version
This mirrors the ELF fix in CL 188957. TestScript/version failed on
darwin after that change.

Fixes #31861

Change-Id: I4ce953ebec8dd5fa47e26d373c59d7e290b75a34
Reviewed-on: https://go-review.googlesource.com/c/go/+/189159
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-08-06 18:00:31 +00:00
Bharath Thiruveedula
8e82624e69 net: fix the docs in IPNet.String
Fixes #33433
Change-Id: Idb3961685a3cfd13ba26155a1d64fc24cc418fdb
Reviewed-on: https://go-review.googlesource.com/c/go/+/189117
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-08-06 15:09:26 +00:00
Jonathan Amsterdam
546ea78efa errors: improve doc
Explain wrapping and how to use Is and As in the package doc.

Explain "chain" in Is and As.

Updates #33364.

Change-Id: Ic06362106dbd129e33dd47e63176ee5355492086
Reviewed-on: https://go-review.googlesource.com/c/go/+/188737
Reviewed-by: Rob Pike <r@golang.org>
2019-08-06 11:13:05 +00:00
Jonathan Amsterdam
a4c825156d doc/go1.13.html: describe error-value additions
A brief description at the top the Standard Library section of the
changes to support error wrapping.

Fixes #33365.

Change-Id: Id5a3b2fe148d9bfb949f2cfc9e5d8a1613a0e219
Reviewed-on: https://go-review.googlesource.com/c/go/+/188798
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-08-05 23:12:39 +00:00
Keith Randall
d1338ec30e syscall: include complete prototype of system calls
The prototypes were truncated because they were on multiple lines
of the source file.

Copied from the STD lines for these functions in
https://svn.freebsd.org/base/stable/12/sys/kern/syscalls.master

Change-Id: I618a5444f1353aabee2758c06f86ad726185d19c
Reviewed-on: https://go-review.googlesource.com/c/go/+/188077
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-08-05 19:01:06 +00:00
Bryan C. Mills
6e11d81b4d cmd/go: adjust expected error message in TestScript/mod_invalid_version
CL 188817 improved the error message for a nonexistent version in a dependency.
This CL locks in that improvement in a regression test.

Fixes #33474

Change-Id: I6246b4995adee966f24eaebe491d35830aea8370
Reviewed-on: https://go-review.googlesource.com/c/go/+/188977
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
2019-08-05 16:54:43 +00:00
Mark Glines
6c74db4024 cmd/go: look for .go.buildinfo section when looking for ELF version
Based on original fix from Mark Glines in golang.org/cl/186737

Fixes #31861

Change-Id: Ibd583a3aa8f8b8eefade998aa2ac757b55140937
Reviewed-on: https://go-review.googlesource.com/c/go/+/188957
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-08-05 16:26:27 +00:00
Shivani Singhal
09c9d3a58a net/http: fix typo in Response.Body's doc
Fixes #33453.

Change-Id: If0aa48f953633690884ddcff033b3be6d1d66443
Reviewed-on: https://go-review.googlesource.com/c/go/+/188541
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
2019-08-05 05:44:06 +00:00
Agniva De Sarker
a2f5d644d3 doc/go1.13: add release notes for GOWASM environment variable
Change-Id: I103a21ae0be8feb9447fa277483b7c2a8b5807e7
Reviewed-on: https://go-review.googlesource.com/c/go/+/188540
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Richard Musiol <neelance@gmail.com>
2019-08-03 08:47:32 +00:00
Ian Lance Taylor
fc821667dd os: change Readdirnames doc to follow that of Readdir
The two methods act the same, so make their documentation similar so
that people don't think they act differently.

Change-Id: If224692ef50870faf855d789380a614d1e724132
Reviewed-on: https://go-review.googlesource.com/c/go/+/188137
Reviewed-by: Rob Pike <r@golang.org>
2019-08-02 21:52:01 +00:00
Damien Neil
d178c5888f os: don't consult Is methods on non-syscall error types
CL #163058 moves interpretation of platform-specific errors to the
syscall package. Package syscall errors implement an Is method which
os.IsPermission etc. consult. This results in an unintended semantic
change to the os package predicate functions: The following program
now prints 'true' where it used to print 'false':

	package main
	import "os"
	type myError struct{ error }
	func (e myError) Is(target error) bool { return target == os.ErrPermission }
	func main() { println(os.IsPermission(myError{})) }

Change the os package error predicate functions to only examine syscall
errors, avoiding this semantic change.

This CL does retain one minor semantic change: On Plan9, os.IsPermission
used to return true for any error with text containing the string
"permission denied". It now only returns true for a syscall.ErrorString
containing that text.

Change-Id: I6b512b1de6ced46c2f1cc8d264fa2495ae7bf9f5
Reviewed-on: https://go-review.googlesource.com/c/go/+/188817
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2019-08-02 21:09:50 +00:00
Ian Lance Taylor
55e23cb1fe doc/go1.13: mention confusion between keep-alive timeout and deadline
Updates #31449

Change-Id: I4d7075b20cd8171bc792e40b388f4215264a3317
Reviewed-on: https://go-review.googlesource.com/c/go/+/188819
Reviewed-by: Filippo Valsorda <filippo@golang.org>
2019-08-02 21:03:47 +00:00
Bryan C. Mills
07b3e629ce cmd/go: report loading errors from 'go mod tidy' and 'go mod vendor'
Fixes #27063

Change-Id: Iedd14fd614a3d79d1387b923a0f123c2bc9e0b33
Reviewed-on: https://go-review.googlesource.com/c/go/+/188763
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-08-02 20:48:58 +00:00
Keith Randall
316ac4f330 cmd/compile: fix crash on write barrier insertion
The compiler can crash if the compiled code tries to
unconditionally read from a nil pointer. This should cause
the generated binary to panic, not the compiler.

Fixes #33438

Change-Id: Ic8fa89646d6968e2cc4e27da0ad9286662f8bc49
Reviewed-on: https://go-review.googlesource.com/c/go/+/188760
Reviewed-by: Austin Clements <austin@google.com>
2019-08-02 19:35:37 +00:00
Emmanuel T Odeke
bdea352b96 doc/go1.13: document net/http.Transport.Request.Body unfurling
Documents the work from:
* CL 163599
* CL 163737

which now uses the Request.Body's io.ReaderFrom implementation,
if available, and permits system level optimizations such as
"sendfile" to be used to transmit/upload the Body, which greatly
speeds up file uploads.

Updates #33396

Change-Id: I7b8315c4b3e57ad47bb9be2b0c838857875d4bd5
Reviewed-on: https://go-review.googlesource.com/c/go/+/188457
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-08-02 17:58:08 +00:00
Damien Neil
0e54d28ff7 all: remove os.ErrTimeout
It is unclear whether the current definition of os.IsTimeout is
desirable or not. Drop ErrTimeout for now so we can consider adding it
(or some other error) in a future release with a corrected definition.

Fixes #33411

Change-Id: I8b880da7d22afc343a08339eb5f0efd1075ecafe
Reviewed-on: https://go-review.googlesource.com/c/go/+/188758
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-08-02 17:57:18 +00:00
Alberto Donizetti
2d1a1e0a2a doc: fix Block interface parameters order
The Effective Go document references the crypto/cipher Block
interface, but the parameters' names are swapped. This change
alignes them to the crypto definition, to avoid confusion.

Fixes #33432

Change-Id: I8b9aac4dc6af3eec968bbc8f3ee5366b99016fcc
Reviewed-on: https://go-review.googlesource.com/c/go/+/188797
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-08-02 17:51:34 +00:00
Baokun Lee
2d6ee6e89a os: enable the close-on-exec flag for openFdAt
There's a race here with fork/exec, enable the close-on-exec flag
for the new file descriptor.

Fixes #33405

Change-Id: If95bae97a52b7026a930bb3427e47bae3b0032ac
Reviewed-on: https://go-review.googlesource.com/c/go/+/188537
Run-TryBot: Baokun Lee <nototon@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-08-01 20:37:08 +00:00
Darren McCleary
e7c51cad71 net/http: fix a typo in spelling of MultiPartForm
Change-Id: I33a5313ef10e8c88d9c12507573b385fa0843afe
GitHub-Last-Rev: 844d435158
GitHub-Pull-Request: golang/go#33412
Reviewed-on: https://go-review.googlesource.com/c/go/+/188498
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
2019-08-01 20:35:26 +00:00