Commit graph

2411 commits

Author SHA1 Message Date
Andrew Gerrand a00ad5f47e doc: document Go 1.6.1 and Go 1.5.4
Change-Id: Icb9e947a43fb87fbfe0655b09e0d7e8f61825aeb
Reviewed-on: https://go-review.googlesource.com/21825
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-04-11 05:01:44 +00:00
Brad Fitzpatrick b9531d31ac doc: add httptest.ResponseRecorder note to go1.7.txt notes
Fixes #14928

Change-Id: Id772eb623815cb2bb3e49de68a916762345a9dc1
Reviewed-on: https://go-review.googlesource.com/21531
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-04-05 16:05:16 +00:00
Ian Lance Taylor fb9aafac97 doc: GCC 6 will have the Go 1.6 user libraries
Fixes #14759.

Change-Id: I6cef0b49ba00ab85b25ce1e7bad80ad85e2d5076
Reviewed-on: https://go-review.googlesource.com/20545
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
2016-03-11 00:03:15 +00:00
Shenghou Ma 7a05fa8a70 doc: fix dead links in FAQ
Fixes #14741.

Change-Id: Idb8de8b0c1059c15e4c3df4a60bbd340d4e74aba
Reviewed-on: https://go-review.googlesource.com/20487
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-03-10 22:47:21 +00:00
Andrew Gerrand c2400e31ad doc: add doc.Example.Unordered to go1.7.txt
Change-Id: I142a9f97303e3bfbd9522fd061530c0a91305389
Reviewed-on: https://go-review.googlesource.com/20500
Reviewed-by: Minux Ma <minux@golang.org>
2016-03-09 23:31:04 +00:00
Brad Fitzpatrick f02dc513c8 doc: fix bogus HTML in contribute.html
Introduced in https://golang.org/cl/20462

Change-Id: I6c55f87228f0980058a10f204b57ead7594e3492
Reviewed-on: https://go-review.googlesource.com/20490
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-03-09 22:16:43 +00:00
Shenghou Ma a9c48f3b03 doc: security fixes are prepared for two most recent stable releases
Change-Id: Ia22f681b0e90876ec87363c50c6a284db050f649
Reviewed-on: https://go-review.googlesource.com/19793
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-03-09 03:32:23 +00:00
Andrew Gerrand b050adeebd doc: use new Gerrit URL and mention our instance in CONTRIBUTING.md
Fixes #14662

Change-Id: I8f7d5e8d2dd8dc763e940e061b424427359246e7
Reviewed-on: https://go-review.googlesource.com/20462
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-03-09 00:52:42 +00:00
Andrew Gerrand 5011431295 doc: remove link to empty Go 1.5.3 milestone
Fixes #14687

Change-Id: I51fd8842d35c82db71cc5b28c4c0550871461eb6
Reviewed-on: https://go-review.googlesource.com/20421
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-03-09 00:11:02 +00:00
Chris Broadfoot 0024101b2d doc: add link to 1.6 release notes on golang.org/project page
Fixes #14378.

Change-Id: I680b523c01576e42f1dbda9131d1f6bb99b3668b
Reviewed-on: https://go-review.googlesource.com/20138
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-03-03 01:11:02 +00:00
nwidger 5067453271 doc: update release tag in source directions to go1.6
Fixes #14371

Change-Id: I8e9e4b2b89083f5a947e791c011912fdf365a11e
Reviewed-on: https://go-review.googlesource.com/19996
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-03-01 02:02:10 +00:00
Brad Fitzpatrick 351c15f1ce all: remove public named return values when useless
Named returned values should only be used on public funcs and methods
when it contributes to the documentation.

Named return values should not be used if they're only saving the
programmer a few lines of code inside the body of the function,
especially if that means there's stutter in the documentation or it
was only there so the programmer could use a naked return
statement. (Naked returns should not be used except in very small
functions)

This change is a manual audit & cleanup of public func signatures.

Signatures were not changed if:

* the func was private (wouldn't be in public godoc)
* the documentation referenced it
* the named return value was an interesting name. (i.e. it wasn't
  simply stutter, repeating the name of the type)

There should be no changes in behavior. (At least: none intended)

Change-Id: I3472ef49619678fe786e5e0994bdf2d9de76d109
Reviewed-on: https://go-review.googlesource.com/20024
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-02-29 03:31:19 +00:00
Brad Fitzpatrick 31f2ed2cae doc: go1.7.txt updates
Change-Id: I6ac3d11ee8896f636235fe10c2556f93584019b5
Reviewed-on: https://go-review.googlesource.com/19984
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-02-27 01:23:21 +00:00
Ian Lance Taylor 13d6414e9d doc/go1.7: mention CallersFrames and Frames
Change-Id: I73ae6a6837a6dcf75b3b8f431d97a18348e01a42
Reviewed-on: https://go-review.googlesource.com/19921
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-02-25 19:44:56 +00:00
Burcu Dogan 9e173f9db9 doc: add android/arm as a valid GOOS/GOARCH combination
Fixes #14497.

Change-Id: Ibdd55acf9e416873c64f8751c2f65f7ccdb1d500
Reviewed-on: https://go-review.googlesource.com/19914
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-02-25 00:38:16 +00:00
Shenghou Ma c3ecded729 cmd/dist: introduce list subcommand to list all supported platforms
Fixes #12270.

Change-Id: Ie3dcbd0403d270b4b7f5c39049e12315eee159ed
Reviewed-on: https://go-review.googlesource.com/19837
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-24 06:41:08 +00:00
Robert Griesemer 5583e8a421 spec: fix EBNF for slice syntax
The () parentheses grouped wrongly. Removed them completely in
favor of separate 2- and 3-index slice alternatives which is
clearer.

Fixes #14477.

Change-Id: I0b7521ac912130d9ea8740b8793b3b88e2609418
Reviewed-on: https://go-review.googlesource.com/19853
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-02-23 19:18:25 +00:00
Russ Cox 3e23442518 cmd/go: remove GO15VENDOREXPERIMENT variable
The Go 1.6 release notes say that Go 1.7 will remove support
for the GO15VENDOREXPERIMENT environment variable,
making vendoring always on. Do that.

Change-Id: Iba8b79532455828869c1a8076a82edce84259468
Reviewed-on: https://go-review.googlesource.com/19615
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-02-19 01:35:53 +00:00
Russ Cox 51b624e6a2 cmd/link: remove alternate -X flag spelling
The Go 1.6 release notes say we'll remove the “-X name value” form
(in favor of the “-X name=value” form) in Go 1.7.
Do that.

Also establish the doc/go1.7.txt file.

Change-Id: Ie4565a6bc5dbcf155181754d8d92bfbb23c75338
Reviewed-on: https://go-review.googlesource.com/19614
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-02-19 01:35:25 +00:00
Rahul Chaudhry 6b9a0fa356 doc: fix typo in go1.6 release date.
Change-Id: If15fdcd3cd49394a0c1dffd39fbbeede11081ccb
Reviewed-on: https://go-review.googlesource.com/19528
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2016-02-17 23:13:51 +00:00
Chris Broadfoot 6030c75315 doc: document Go 1.6
Change-Id: I4910105d48ed650289ecb1490d556929db05bc38
Reviewed-on: https://go-review.googlesource.com/19526
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-on: https://go-review.googlesource.com/19527
2016-02-17 22:07:28 +00:00
Russ Cox 939a9424de doc: remove DRAFT tags from go1.6.html
Go 1.6 is soon (but not yet).

Fixes #14301.

Change-Id: I85e329b643adcb5d4fa680c5333fbc1f928d4d9d
Reviewed-on: https://go-review.googlesource.com/19550
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2016-02-17 18:25:10 +00:00
Russ Cox f997475129 doc: mention multi-change branches in contribute.html
Fixes #13651.

Change-Id: I1d21b49e2b5bc6c507eb084d6d2553e5a9c607cf
Reviewed-on: https://go-review.googlesource.com/19552
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2016-02-17 18:23:12 +00:00
Russ Cox 095c0e5c00 doc: fix remaining TODOs in Go 1.6 release notes
Fixes #14300.

Change-Id: Idb6a300fe0e06fb8966cf06b55f9b252752a69a6
Reviewed-on: https://go-review.googlesource.com/19459
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-16 16:46:17 +00:00
Austin Clements 62fad436bb doc: tweak Go 1.6 GC release notes
Go 1.6 significantly improves pause times for large heaps, but it
improves them in many other situations as well, such as when goroutine
churn is high, allocation rate is high, or when there are many
finalizers. Hence, make the statement about pause times a bit more
general.

Change-Id: Ic034b1c904c39dd1d966ee7fa96ca8bbb3614e53
Reviewed-on: https://go-review.googlesource.com/19504
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-02-16 16:45:18 +00:00
Austin Clements 18aefe9c19 doc: fix non-possessive "'s"
Currently we use "Section's" as the plural of the debug/elf Section
struct. Change this to "Sections" because it's not possessive and
doesn't seem to fall in to any special cases were the apostrophe is
acceptable.

Change-Id: Id5d3abbd748502a67ead3f483182ee7729db94a2
Reviewed-on: https://go-review.googlesource.com/19505
Reviewed-by: Russ Cox <rsc@golang.org>
2016-02-16 16:44:53 +00:00
Andrew Gerrand 39304eb69d doc: rewrite references to plan9.bell-labs.com to 9p.io
The plan9.bell-labs.com site has fallen into disrepair.
We'll instead use the site maintained by contributor David du Colombier.

Fixes #14233

Change-Id: I0c702e5d3b091cccd42b288ea32f34d507a4733d
Reviewed-on: https://go-review.googlesource.com/19240
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: David du Colombier <0intro@gmail.com>
2016-02-04 22:47:16 +00:00
Ian Lance Taylor fd24e6d561 doc: correct old function names in strconv comments in go1.6 doc
Fixes #14219.

Change-Id: Id398dcfe6e9978d7eefddcdaaaa2256c16237cf3
Reviewed-on: https://go-review.googlesource.com/19207
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
2016-02-04 05:11:55 +00:00
Andrew Gerrand 1ab900e5f1 doc: link to block example in go1.6 doc
Fixes #14143

Change-Id: I2d77e55bc0b6bb42e11de291e0ddb5ad5d620646
Reviewed-on: https://go-review.googlesource.com/19110
Reviewed-by: Russ Cox <rsc@golang.org>
2016-01-29 14:19:36 +00:00
Brad Fitzpatrick 6d61725c36 doc: don't imply that the new HTTP status 451 is from RFC 6585
From twitter bug report: https://twitter.com/ox/status/692737249411207168

Change-Id: Ic5f4eeb00d705217542db558edc25e206f6b640d
Reviewed-on: https://go-review.googlesource.com/19050
Reviewed-by: Russ Cox <rsc@golang.org>
2016-01-28 21:10:22 +00:00
Russ Cox 01ca4da0ef doc: mention ServeFile change in go1.6.html
Also fix a few bad links.

Change-Id: If04cdd312db24a827a3c958a9974c50ab148656c
Reviewed-on: https://go-review.googlesource.com/18979
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-01-27 18:05:00 +00:00
Ian Lance Taylor 08396f7825 doc: mention signal changes for c-archive/c-shared
Change-Id: Ibba7fccba9617612e026bd0a208eb12918de465a
Reviewed-on: https://go-review.googlesource.com/18985
Reviewed-by: Russ Cox <rsc@golang.org>
2016-01-27 17:30:54 +00:00
Brad Fitzpatrick d3e61747da doc: mention the need for a C compiler for cgo support
Fixes #13954

Change-Id: I4c01e9bb3fb08e8b9fa14d4c59b7ea824ba3f0c9
Reviewed-on: https://go-review.googlesource.com/18937
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-01-26 23:50:17 +00:00
Alberto Donizetti bdc3db0b0c doc: update install from source instructions for go1.5.3
Fixes #14020

Change-Id: I454c2613912a7efcb464c6e6f3ac2e0ec89fb719
Reviewed-on: https://go-review.googlesource.com/18750
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2016-01-26 19:39:17 +00:00
Dominik Honnef 7d8c8c07aa doc: missing words and letters in release notes
Change-Id: Ica7f2a000eb1d89d5b02cb8c6f1596ddc04bfb26
Reviewed-on: https://go-review.googlesource.com/18890
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-01-23 05:47:13 +00:00
Andrew Gerrand 4a8c15e066 doc: revise help page with categories and more links
Fixes #12489

Change-Id: I25dd3f76e4cfe9a71b987c3b31445724568391e9
Reviewed-on: https://go-review.googlesource.com/18625
Reviewed-by: Russ Cox <rsc@golang.org>
2016-01-14 03:15:39 +00:00
Russ Cox 353ee32f88 doc: document archive/tar changes
Fixes #13647.

Change-Id: I28df7ade9b5abd79ce6b9c3d14ceaa988e86fc01
Reviewed-on: https://go-review.googlesource.com/18642
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-01-14 03:08:30 +00:00
Russ Cox 1ac637c766 cmd/compile: recognize Syscall-like functions for liveness analysis
Consider this code:

	func f(*int)

	func g() {
		p := new(int)
		f(p)
	}

where f is an assembly function.
In general liveness analysis assumes that during the call to f, p is dead
in this frame. If f has retained p, p will be found alive in f's frame and keep
the new(int) from being garbage collected. This is all correct and works.
We use the Go func declaration for f to give the assembly function
liveness information (the arguments are assumed live for the entire call).

Now consider this code:

	func h1() {
		p := new(int)
		syscall.Syscall(1, 2, 3, uintptr(unsafe.Pointer(p)))
	}

Here syscall.Syscall is taking the place of f, but because its arguments
are uintptr, the liveness analysis and the garbage collector ignore them.
Since p is no longer live in h once the call starts, if the garbage collector
scans the stack while the system call is blocked, it will find no reference
to the new(int) and reclaim it. If the kernel is going to write to *p once
the call finishes, reclaiming the memory is a mistake.

We can't change the arguments or the liveness information for
syscall.Syscall itself, both for compatibility and because sometimes the
arguments really are integers, and the garbage collector will get quite upset
if it finds an integer where it expects a pointer. The problem is that
these arguments are fundamentally untyped.

The solution we have taken in the syscall package's wrappers in past
releases is to insert a call to a dummy function named "use", to make
it look like the argument is live during the call to syscall.Syscall:

	func h2() {
		p := new(int)
		syscall.Syscall(1, 2, 3, uintptr(unsafe.Pointer(p)))
		use(unsafe.Pointer(p))
	}

Keeping p alive during the call means that if the garbage collector
scans the stack during the system call now, it will find the reference to p.

Unfortunately, this approach is not available to users outside syscall,
because 'use' is unexported, and people also have to realize they need
to use it and do so. There is much existing code using syscall.Syscall
without a 'use'-like function. That code will fail very occasionally in
mysterious ways (see #13372).

This CL fixes all that existing code by making the compiler do the right
thing automatically, without any code modifications. That is, it takes h1
above, which is incorrect code today, and makes it correct code.

Specifically, if the compiler sees a foreign func definition (one
without a body) that has uintptr arguments, it marks those arguments
as "unsafe uintptrs". If it later sees the function being called
with uintptr(unsafe.Pointer(x)) as an argument, it arranges to mark x
as having escaped, and it makes sure to hold x in a live temporary
variable until the call returns, so that the garbage collector cannot
reclaim whatever heap memory x points to.

For now I am leaving the explicit calls to use in package syscall,
but they can be removed early in a future cycle (likely Go 1.7).

The rule has no effect on escape analysis, only on liveness analysis.

Fixes #13372.

Change-Id: I2addb83f70d08db08c64d394f9d06ff0a063c500
Reviewed-on: https://go-review.googlesource.com/18584
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-01-14 01:16:45 +00:00
Russ Cox 4525571f7e doc: document Go 1.5.3
Change-Id: I9b4b76abfba66ff655aef55b43d9b4721aba604a
Reviewed-on: https://go-review.googlesource.com/18587
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2016-01-13 17:48:41 +00:00
Andrew Gerrand 1abb863d83 doc: add Overview and other small edits to How To Write Go Code
Fixes #9228

Change-Id: Ic4df4a39f6f363bdd6eb9228c8164e6e9dccee1b
Reviewed-on: https://go-review.googlesource.com/5561
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2016-01-12 01:56:04 +00:00
Adam Langley 109d54a32d doc: note GCM behaviour change in Go 1.6.
This change documents the behaviour change caused by
https://go-review.googlesource.com/18480 in Go 1.6.

Updates #13886

Change-Id: I2daa08a62775bbc209f0f4cbeae21b8184ce7609
Reviewed-on: https://go-review.googlesource.com/18481
Reviewed-by: Russ Cox <rsc@golang.org>
2016-01-10 19:03:54 +00:00
Russ Cox 20d745c57c encoding/base64: fix streaming decode of padding-free base64
Fixes #13384.

Change-Id: Id9e827acddc8de139f93c5de0c6486bc4334c7d4
Reviewed-on: https://go-review.googlesource.com/18330
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-01-08 15:07:45 +00:00
Russ Cox f962fc0820 doc: mention that Go no longer calls timeBeginPeriod(1) on Windows
Fixes #13731.

Change-Id: Iaf70a8b41c947f0d86013808564112ab676136e3
Reviewed-on: https://go-review.googlesource.com/18345
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2016-01-07 04:16:14 +00:00
Michael Hudson-Doyle b00105d878 doc: update 1.6 release notes with buildmode progress
Fixes #13358

Change-Id: I57ed50c2610cab11fb3d9749f9e7d4a37daa7977
Reviewed-on: https://go-review.googlesource.com/18276
Reviewed-by: Russ Cox <rsc@golang.org>
2016-01-07 04:15:08 +00:00
Russ Cox 73ba846c6a doc: remove note about installing from source for ARM
Now there are ARM downloads too.

Change-Id: I236381508c69d56748e672d184b92caa715e81ae
Reviewed-on: https://go-review.googlesource.com/18342
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-01-07 04:12:01 +00:00
Andrew Gerrand e9fc522100 doc: show relevant test instructions on install page
Fixes golang/go#12490

Change-Id: I0861e62aaa589fc63217c83e9c227c17e35cda75
Reviewed-on: https://go-review.googlesource.com/18277
Reviewed-by: Russ Cox <rsc@golang.org>
2016-01-07 01:41:19 +00:00
Ian Lance Taylor bd7086996c doc: fix incorrect example in asm.html
Fixes #13845.

Change-Id: Ie83179b2d20c47a0296645d9e2fdc43271be495a
Reviewed-on: https://go-review.googlesource.com/18307
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-01-06 23:17:25 +00:00
Russ Cox fc1793dde9 doc: document release support policy
Fixes #12790.

Change-Id: I0f231d198c76632c23692fc1337b57cfeafaf4c7
Reviewed-on: https://go-review.googlesource.com/18338
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-01-06 22:07:13 +00:00
Russ Cox d02193c628 doc: document linux/ppc64 kernel requirement (2.6.37 or later)
Fixes #13269.

Change-Id: I960d1825bda9d8873c2a9005872c45e4c7d30111
Reviewed-on: https://go-review.googlesource.com/18339
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-01-06 22:06:36 +00:00
Russ Cox 6e28bf3795 doc: fix source link in gdb docs
Fixes #12059.

Change-Id: Ib5caf8133cd3ed888f9102dfbfeca11c506f3b5b
Reviewed-on: https://go-review.googlesource.com/18337
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-01-06 21:58:19 +00:00