Commit Graph

25759 Commits

Author SHA1 Message Date
Emmanuel Odeke
90a6893573 doc: fix typo in go1.6.html
Change-Id: I7405cf6f65bccbb07a27f2dc2e3802cab591e296
Reviewed-on: https://go-review.googlesource.com/18030
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-18 01:23:00 +00:00
Ian Lance Taylor
ebf64bcc24 cmd/vet: add some checks for invalid pointer passing using cgo
Update #12416.

Change-Id: I21d97cbe211ccc8048e5a78ea4d89664f4d195ba
Reviewed-on: https://go-review.googlesource.com/17041
Reviewed-by: Russ Cox <rsc@golang.org>
2015-12-18 00:31:21 +00:00
Shenghou Ma
63f0aac586 test: fix linkmain test
Change-Id: Ie8ec4cfc68abef51e52090a75245f96af874c74a
Reviewed-on: https://go-review.googlesource.com/18000
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-12-17 23:36:13 +00:00
Alan Donovan
a750149579 go/types: add link to tutorial
Change-Id: Ic4f4bc7ea7478908716b951815280e394c55310b
Reviewed-on: https://go-review.googlesource.com/17975
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-12-17 23:02:07 +00:00
Brad Fitzpatrick
8db371b3d5 api: create go1.6.txt
Change-Id: If2b30ab412d6799c8be01eb007462d6b58660ece
Reviewed-on: https://go-review.googlesource.com/18014
Reviewed-by: Chris Broadfoot <cbro@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-12-17 22:45:50 +00:00
Brad Fitzpatrick
4577cfcb0b src: remove reference to since-deleted dist -s flag
(Found while debugging release problems with go1.6beta1)

Updates #12002

Change-Id: Iec197a754205e7fd28be154f27f17f3315886364
Reviewed-on: https://go-review.googlesource.com/18011
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2015-12-17 22:03:56 +00:00
Brad Fitzpatrick
41af93f6a3 doc: change go1.6 http heading
Change-Id: Iae05082530891175e9c86da244e610bc92759561
Reviewed-on: https://go-review.googlesource.com/17918
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2015-12-17 21:43:12 +00:00
Brad Fitzpatrick
a12ba4b832 doc: Americanise spelling of wilful
Fixes #13660

Change-Id: I05bcb4efcb865192a1ef6756e9dccef83505934c
Reviewed-on: https://go-review.googlesource.com/17990
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2015-12-17 21:32:59 +00:00
Brad Fitzpatrick
c70df74aab net/http: document ResponseWriter and Handler more; add test
Update docs on ResponseWriter and Handler around concurrency.

Also add a test.

The Handler docs were old and used "object" a lot. It was also too
ServeMux-centric.

Fixes #13050
Updates #13659 (new issue found in http2 while writing the test)

Change-Id: I25f53d5fa54f1c9d579d3d0f191bf3d94b1a251b
Reviewed-on: https://go-review.googlesource.com/17982
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-17 21:21:31 +00:00
Russ Cox
c7b1ef9918 cmd/link: reject non-package main toplevel.a file, remove dead code
The test for non-package main top-level inputs is done while parsing
the export data. Issue #13468 happened because we were not parsing
the export data when using compiler-generated archives
(that is, when using go tool compile -pack).

Fix this by parsing the export data even for archives.

However, that turns up a different problem: the export data check
reports (one assumes spurious) skew errors now, because it has
not been run since Go 1.2.
(Go 1.3 was the first release to use go tool compile -pack.)

Since the code hasn't run since Go 1.2, it can't be that important.
Since it doesn't work today, just delete it.

Figuring out how to make this code work with Robert's export
format was one of the largest remaining TODOs for that format.
Now we don't have to.

Fixes #13468 and makes the world a better place.

Change-Id: I40a4b284cf140d49d48b714bd80762d6889acdb9
Reviewed-on: https://go-review.googlesource.com/17976
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-12-17 20:59:51 +00:00
Russ Cox
2f08bd96a0 cmd/go: for go get -insecure, do not fall back to HTTP for non-200 responses
Since we allow non-200 responses from HTTPS in normal operation,
it seems odd to reject them in -insecure operation.

Fixes #13037 (again).

Change-Id: Ie232f7544ab192addfad407525888db6b967befe
Reviewed-on: https://go-review.googlesource.com/17945
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-17 20:28:14 +00:00
Russ Cox
a227351b62 cmd/go: fix processing of HTTPS 404 without -insecure
The change here is to move the closeBody call into the if block.
The logging adjustments are just arranging to tell the truth:
in particular if we're not in insecure mode and we get a non-200
error then we do not actually ignore the response
(except as caused by closing the body incorrectly).

As the comment below the change indicates, it is intentional that
we process non-200 pages. The code does process them, because
the if err != nil || status != 200 block does not return.
But that block does close the body, which depending on timing
can apparently poison the later read from the body.

See #13037's initial report:

	$ go get -v bosun.org/cmd/bosun/cache
	Fetching https://bosun.org/cmd/bosun/cache?go-get=1
	ignoring https fetch with status code 404
	Parsing meta tags from https://bosun.org/cmd/bosun/cache?go-get=1 (status code 404)
	import "bosun.org/cmd/bosun/cache": parsing bosun.org/cmd/bosun/cache: http: read on closed response body
	package bosun.org/cmd/bosun/cache: unrecognized import path "bosun.org/cmd/bosun/cache"

The log print about ignoring the https fetch is not strictly true,
since the next thing that happened was parsing the body of that fetch.
But the read on the closed response body failed during parsing.

Moving the closeBody to happen only when we're about to discard the
result and start over (that is, only in -insecure mode) fixes the parse.

At least it should fix the parse. I can't seem to break the parse anymore,
because of #13648 (close not barring future reads anymore),
but this way is clearly better than the old way. If nothing else the old code
closed the body twice when err != nil and -insecure was not given.

Fixes #13037.

Change-Id: Idf57eceb6d5518341a2f7f75eb8f8ab27ed4e0b4
Reviewed-on: https://go-review.googlesource.com/17944
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-17 20:28:00 +00:00
Russ Cox
9f0055a232 Revert "cmd/go: allow omitted user name in git ssh repo syntax"
This caused #13657.
Reverting fixes #13657.

I was trying to be helpful by fixing #12313,
but I don't need the fix myself.
Will leave for someone with more motivation.

This reverts commit 3e9f063670.

Change-Id: Ifc78a6196f23e0f58e3b9ad7340e207a2d5de0a6
Reviewed-on: https://go-review.googlesource.com/17977
Reviewed-by: Russ Cox <rsc@golang.org>
2015-12-17 20:25:42 +00:00
Brad Fitzpatrick
c052222b34 net/http: don't accept invalid bytes in server request headers
Fixes #11207

Change-Id: I7f00b638e749fbc7907dc1597347ea426367d13e
Reviewed-on: https://go-review.googlesource.com/17980
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-12-17 20:22:08 +00:00
Brad Fitzpatrick
18227bb7b6 net/http: be more consistent about Request.Method "" vs "GET"
Patch from Russ.

No bug identified, but I didn't search exhaustively. The new code is
easier to read.

Fixes #13621

Change-Id: Ifda936e4101116fa254ead950b5fe06adb14e977
Reviewed-on: https://go-review.googlesource.com/17981
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-12-17 20:21:44 +00:00
Russ Cox
761ac75a94 cmd/go: fix git submodule fetch
Thanks to @toxeus on GitHub for the test case.

Fixes #12612.

Change-Id: I0c32fbe5044f3552053460a5347c062568093dff
Reviewed-on: https://go-review.googlesource.com/17974
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-17 20:18:18 +00:00
Brad Fitzpatrick
66fcf56729 net/http: update bundled http2, add tests reading response Body after Close
Updates to golang.org/x/net/http2 git rev 28273ec9 for
https://golang.org/cl/17937

Fixes #13648

Change-Id: I27c77524b2e4a172c5f8be08f6fbb0f2e2e4b200
Reviewed-on: https://go-review.googlesource.com/17938
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-17 19:49:13 +00:00
Ian Lance Taylor
54977cd3de cmd/go: runtime and runtime/internal packages depend on runtime/internal/sys
Fixes #13655.

Change-Id: I764019aecdd59743baa436b7339499e6c2126268
Reviewed-on: https://go-review.googlesource.com/17916
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-12-17 19:37:18 +00:00
Russ Cox
0cb68acea2 cmd/go: respect umask when creating executables
Also update many call sites where I forgot that the permission
argument is going to be masked by umask.

Fixes #12692.

Change-Id: I52b315b06236122ca020950447863fa396b68abd
Reviewed-on: https://go-review.googlesource.com/17950
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-12-17 19:24:06 +00:00
Brad Fitzpatrick
807c6c58fc net: fix the build even harder
Should fix nacl.

Follow-up to
https://golang.org/cl/17936 (fix race) and
https://golang.org/cl/17914 (fix build) for
https://golang.org/cl/16953 (broke the build)

Third time's a charm.

Change-Id: I23930d5cff4235209546952ce2231f165ab5bf8a
Reviewed-on: https://go-review.googlesource.com/17939
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-12-17 18:43:12 +00:00
Russ Cox
d270a6794b runtime: disable gdb test when a GOROOT_FINAL move is pending
Fixes #13577.

Change-Id: I0bb8157d6210b0c7c09380c2163b7d7349495732
Reviewed-on: https://go-review.googlesource.com/17970
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-12-17 17:56:15 +00:00
Brad Fitzpatrick
cfc9fde54d net/http: updated bundled http2 to finish trailer support
This updates the bundled copy of x/net/http2 to git rev d2ecd08
for https://golang.org/cl/17912 (http2: send client trailers)
and enables the final Trailer test for http2.

Fixes #13557

Change-Id: Iaa15552b82bf7a2cb01b7787a2e1ec5ee680a9d3
Reviewed-on: https://go-review.googlesource.com/17935
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-12-17 17:50:30 +00:00
Alex Brainman
f172a28f24 net: include both ipv4 and ipv6 netsh output in TestInterfacesWithNetsh
Also include test for interface state (up or down).

Updates #13606

Change-Id: I03538d65525ddd9c2d0254761861c2df7fc5bd5a
Reviewed-on: https://go-review.googlesource.com/17850
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Run-TryBot: Russ Cox <rsc@golang.org>
2015-12-17 17:41:41 +00:00
Brad Fitzpatrick
3ad3d5931b net: fix race in test
Fixes race builders, broken in https://golang.org/cl/16953

Change-Id: Id61171672b69d0ca412de4b44bf2c598fe557906
Reviewed-on: https://go-review.googlesource.com/17936
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-12-17 17:26:30 +00:00
Russ Cox
0d641c754f cmd/go: allow ~ as first char of path element in general git import paths
This makes go get gitserver/~user/repo.git/foo work.

Fixes #9193.

Change-Id: I8c9d4096903288f7f0e82d6ed1aa78bf038fb81a
Reviewed-on: https://go-review.googlesource.com/17952
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-17 17:13:03 +00:00
Russ Cox
06b46c0d9c cmd/go: don't be clever about mtime precision in test
This doesn't happen enough in the tests to be worth debugging.
Empirically, I expect this to add 5 seconds to the overall 'go test -short cmd/go'
on systems with precise file systems, and nothing on systems without them
(like my Mac).

Fixes #12205.

Change-Id: I0a17cb37bdedcfc0f921c5ee658737f1698c153b
Reviewed-on: https://go-review.googlesource.com/17953
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-12-17 17:06:15 +00:00
Russ Cox
e357eb97a6 cmd/go: document that package documentation is ignored
Fixes #11801.

Change-Id: I2caeac7fdddc7f29015d6db8d4b3e296c8b9c423
Reviewed-on: https://go-review.googlesource.com/17954
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-17 17:04:55 +00:00
Russ Cox
aaa0bc1043 net/http: document a few ServeMux behaviors
Fixes #13639.
Fixes #11757.

Change-Id: Iecf9ebcd652c23c96477305a41082e5b63b41d83
Reviewed-on: https://go-review.googlesource.com/17955
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-17 17:03:05 +00:00
Russ Cox
3e9f063670 cmd/go: allow omitted user name in git ssh repo syntax
No test because the code has no test.

Fixes #12313.

Change-Id: I2cfd0a0422c0cd76f0371c2d3bbbdf5bb3b3f1eb
Reviewed-on: https://go-review.googlesource.com/17951
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-17 17:01:05 +00:00
Russ Cox
f9137c5373 cmd/go: document that tests run in the source directory
Fixes #13538.

Change-Id: I621bbe2befe838d16d3664d7a5e30d5d7cceae33
Reviewed-on: https://go-review.googlesource.com/17949
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-17 17:00:37 +00:00
Russ Cox
f474885f8a cmd/go: document where get writes, and not vendor directories
Fixes #12260.

Change-Id: I95c27aad6de8064b9a205d4ee507bce75926f16d
Reviewed-on: https://go-review.googlesource.com/17948
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-17 17:00:02 +00:00
Russ Cox
8fac7e3cc7 cmd/go: document that go generate accepts all build flags
Fixes #12544.

Change-Id: I5e2fd1fbb21816e9f6fb022e2664484a71093b04
Reviewed-on: https://go-review.googlesource.com/17947
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-17 16:59:46 +00:00
Ian Lance Taylor
ab39b8de7e os/signal: document signal handling
This is an attempt to document the current state of signal handling.
It's not intended to describe the best way to handle signals.  Future
changes to signal handling should update these docs as appropriate.

update #9896.

Change-Id: I3c50af5cc641357b57dfe90ae1c7883a7e1ec059
Reviewed-on: https://go-review.googlesource.com/17877
Reviewed-by: Russ Cox <rsc@golang.org>
2015-12-17 16:59:39 +00:00
Russ Cox
0a0f8bae27 cmd/go: document that -p applies to test binary execution
Fixes #11521.

Change-Id: I73615b881df4a0d5e2f5bc5059359d150ca8c105
Reviewed-on: https://go-review.googlesource.com/17946
Reviewed-by: Joe Shaw <joe@joeshaw.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-17 16:59:30 +00:00
Brad Fitzpatrick
7688f0d9fb cmd/pprof: fix scaling of "gigabyte" unit
Fixes #13654

Change-Id: Id2ce32c52efcfdbd66630725d62d2ca6bf0916d5
Reviewed-on: https://go-review.googlesource.com/17934
Reviewed-by: Russ Cox <rsc@golang.org>
2015-12-17 16:38:28 +00:00
mattn
7a48117899 os,internal/syscall/windows: use ReadFile/MultiByteToWideChar to read from console
Fixes #6303

Change-Id: Ib2cd15ac6106ef8e6b975943db8efc8d8ab21052
Reviewed-on: https://go-review.googlesource.com/4310
Reviewed-by: Russ Cox <rsc@golang.org>
2015-12-17 16:23:39 +00:00
Brad Fitzpatrick
8cdd7d14ac net: fix build
https://golang.org/cl/16953 broke the world.

Change-Id: I7cbd4105338ff896bd0c8f69a0b126b6272be2e5
Reviewed-on: https://go-review.googlesource.com/17914
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-17 16:06:58 +00:00
Brad Fitzpatrick
53a207131d net/http: document that ListenAndServe is a bit more than Listen+Serve
Document that ListenAndServe and ListenAndServeTLS also set TCP
keep-alives.

Fixes #12748

Change-Id: Iba2e8a58dd657eba326db49a6c872e2d972883a4
Reviewed-on: https://go-review.googlesource.com/17681
Reviewed-by: Russ Cox <rsc@golang.org>
2015-12-17 15:54:24 +00:00
Joe Tsai
7a2913c9f5 archive/tar: document how Reader.Read handles header-only files
Commit dd5e14a751 ensured that no data
could be read for header-only files regardless of what the Header.Size
said. We should document this fact in Reader.Read.

Updates #13647

Change-Id: I4df9a2892bc66b49e0279693d08454bf696cfa31
Reviewed-on: https://go-review.googlesource.com/17913
Reviewed-by: Russ Cox <rsc@golang.org>
2015-12-17 15:48:10 +00:00
Dan Peterson
5c0629b503 net: prefer error for original name on lookups
With certain names and search domain configurations the
returned error would be one encountered while querying a
generated name instead of the original name. This caused
confusion when a manual check of the same name produced
different results.

Now prefer errors encountered for the original name.

Also makes the low-level DNS connection plumbing swappable
in tests enabling tighter control over responses without
relying on the network.

Fixes #12712
Updates #13295

Change-Id: I780d628a762006bb11899caf20b5f97b462a717f
Reviewed-on: https://go-review.googlesource.com/16953
Reviewed-by: Russ Cox <rsc@golang.org>
2015-12-17 15:17:06 +00:00
Russ Cox
be7544be23 crypto/x509: handle CRLDistributionPoints without FullNames
Fixes #12910.

Change-Id: If446e5dce236483bbb898cc5959baf8371f05142
Reviewed-on: https://go-review.googlesource.com/17550
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
2015-12-17 07:17:28 +00:00
Russ Cox
70cee781fc cmd/go: use tags when evaluating file system wildcards like ./...
Thanks to Albert Hafvenström for the diagnosis.

Fixes #11246.

Change-Id: I2b9e670c0ecf6aa01e5bf4d7a402619e93cc4f4a
Reviewed-on: https://go-review.googlesource.com/17942
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-12-17 05:46:29 +00:00
Russ Cox
37f2afa625 cmd/go: disable use of -linkmode=external in tests when CGO_ENABLED=0
If cgo is turned off, there may not be an external linker available.

Fixes #13450.

Change-Id: Idbf3f3f57b4bb3908b67264f96d276acc952102a
Reviewed-on: https://go-review.googlesource.com/17941
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-12-17 05:46:21 +00:00
Russ Cox
4378746a4b cmd/dist: show output from failed compiler execution
Maybe it will say something that helps the user understand the problem.

Note that we can't use os/exec.ExitError's new Stderr field because
cmd/dist is compiled with Go 1.4.

Fixes #13099.

Change-Id: I4b5910434bf324d1b85107002a64684d8ba14dc8
Reviewed-on: https://go-review.googlesource.com/17940
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-17 03:14:11 +00:00
Ian Lance Taylor
fcbf04f9b9 cmd/cgo: gccgo support for cgoCheckPointer
This uses weak declarations so that it will work with current versions
of gccgo that do not support pointer checking.

Change-Id: Ia34507e3231ac60517cb6834f0b673764715a256
Reviewed-on: https://go-review.googlesource.com/17429
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-12-17 03:01:38 +00:00
Joe Tsai
2ae895c0ce archive/tar: spell license correctly in example
Change-Id: Ice85d161f026a991953bd63ecc6ec80f8d06dfbd
Reviewed-on: https://go-review.googlesource.com/17901
Run-TryBot: Joe Tsai <joetsai@digital-static.net>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-17 02:46:41 +00:00
Brad Fitzpatrick
64de502caa net/http: update Response.Trailer doc
I updated this in the previous commit (https://golang.org/cl/17931)
but noticed a typo. and it still wasn't great.

The Go 1.5 text was too brief to know how to use it:

    // Trailer maps trailer keys to values, in the same
    // format as the header.

Change-Id: I33c49b6a4a7a3596735a4cc7865ad625809da900
Reviewed-on: https://go-review.googlesource.com/17932
Reviewed-by: Russ Cox <rsc@golang.org>
2015-12-17 02:46:04 +00:00
Russ Cox
8350e06556 cmd/go: add -args to 'go test' to resolve -v ambiguity
The new flag -args stops flag processing, leaving the rest of the command line
to be passed to the underlying test binary verbatim. Thus, both of these pass
a literal -v -n on the test binary command line, without putting the go command
into verbose mode or disabling execution of commands:

	go test . -args -v -n
	go test -args -v -n

Also try to make the documentation a bit clearer.

Fixes #7221.
Fixes #12177.

Change-Id: Ief9e830a6fbb9475d96011716a86e2524a35eceb
Reviewed-on: https://go-review.googlesource.com/17775
Reviewed-by: Rob Pike <r@golang.org>
2015-12-17 01:59:58 +00:00
Russ Cox
5c596b51fd Revert "cmd/dist: fix build after "go test" argument order change"
No longer needed - the change to 'go test' was rolled back.

This reverts commit 2c96e5d2fc.

Change-Id: Ibe9c5f48e3e4cbbbde2f5c8c516b2987ebba55ae
Reviewed-on: https://go-review.googlesource.com/17776
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
2015-12-17 01:43:47 +00:00
Russ Cox
e5ba367c10 go/build: disable test on nacl (and a few others, unnecessarily)
Fixes build.

Change-Id: Ia71fc031cc8eb575e5ab5323ff4084147d143744
Reviewed-on: https://go-review.googlesource.com/17867
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-17 01:43:05 +00:00