]> Cypherpunks repositories - gostls13.git/log
gostls13.git
10 years agodoc/go1.4.html: leave stack size at 2 kB
Russ Cox [Thu, 6 Nov 2014 20:19:16 +0000 (15:19 -0500)]
doc/go1.4.html: leave stack size at 2 kB

LGTM=r
R=khr, r
CC=golang-codereviews
https://golang.org/cl/165590043

10 years agodoc: change "/s/..." links to be on golang.org
Russ Cox [Thu, 6 Nov 2014 20:18:47 +0000 (15:18 -0500)]
doc: change "/s/..." links to be on golang.org

People viewing this locally will not have a /s/ on their local godoc.
tip.golang.org doesn't have one either.

Also change all golang.org links to https, to avoid mixed content
warnings when viewing https://golang.org/.

Fixes #9028.

LGTM=bradfitz, r
R=r, bradfitz
CC=adg, golang-codereviews
https://golang.org/cl/168250043

10 years agotest: move linkx and sinit to run.go
Josh Bleecher Snyder [Thu, 6 Nov 2014 20:14:08 +0000 (15:14 -0500)]
test: move linkx and sinit to run.go

The remaining run-only tests will be migrated to run.go in another CL.

This CL will break the build due to issues 8746 and 8806.

Update #4139
Update #8746
Update #8806

LGTM=rsc
R=rsc, bradfitz, iant
CC=golang-codereviews
https://golang.org/cl/144630044

10 years agoruntime: don't stop bitmap dump at BitsDead
Keith Randall [Thu, 6 Nov 2014 17:30:41 +0000 (09:30 -0800)]
runtime: don't stop bitmap dump at BitsDead

Stack bitmaps need to be scanned past any BitsDead entries.

Object bitmaps will not have any BitsDead in them (bitmap extraction stops at
the first BitsDead entry in makeheapobjbv).  data/bss bitmaps also have no BitsDead entries.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/168270043

10 years agoruntime: fix initial gp->sched.pc in newextram
Russ Cox [Thu, 6 Nov 2014 14:37:04 +0000 (09:37 -0500)]
runtime: fix initial gp->sched.pc in newextram

CL 170720043 missed this one when adding +PCQuantum.

LGTM=iant
R=r, iant
CC=golang-codereviews
https://golang.org/cl/168090043

10 years agoos: document that users of Fd should keep f alive
Russ Cox [Thu, 6 Nov 2014 14:36:51 +0000 (09:36 -0500)]
os: document that users of Fd should keep f alive

Fixes #9046.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/162680043

10 years agoos/exec: tell lsof not to block
Keith Randall [Thu, 6 Nov 2014 04:25:20 +0000 (20:25 -0800)]
os/exec: tell lsof not to block

For some reason lsof is now hanging on my workstation
without the -b (avoid blocking in the kernel) option.
Adding -b makes the test pass and shouldn't hurt.

I don't know how recent the -b option is.  If the builders
are ok with it, it's probably ok.

LGTM=rsc
R=golang-codereviews, bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/166220043

10 years agobufio: remove unused 'panicked' variable from test
Andrew Gerrand [Thu, 6 Nov 2014 04:22:29 +0000 (15:22 +1100)]
bufio: remove unused 'panicked' variable from test

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/166230044

10 years agoruntime: avoid gentraceback of self on user goroutine stack
Russ Cox [Thu, 6 Nov 2014 04:01:48 +0000 (23:01 -0500)]
runtime: avoid gentraceback of self on user goroutine stack

Gentraceback may grow the stack.
One of the gentraceback wrappers may grow the stack.
One of the gentraceback callback calls may grow the stack.
Various stack pointers are stored in various stack locations
as type uintptr during the execution of these calls.
If the stack does grow, these stack pointers will not be
updated and will start trying to decode stack memory that
is no longer valid.

It may be possible to change the type of the stack pointer
variables to be unsafe.Pointer, but that's pretty subtle and
may still have problems, even if we catch every last one.
An easier, more obviously correct fix is to require that
gentraceback of the currently running goroutine must run
on the g0 stack, not on the goroutine's own stack.

Not doing this causes faults when you set
        StackFromSystem = 1
        StackFaultOnFree = 1

The new check in gentraceback will catch future lapses.

The more general problem is calling getcallersp but then
calling a function that might relocate the stack, which would
invalidate the result of getcallersp. Add note to stubs.go
declaration of getcallersp explaining the problem, and
check all existing calls to getcallersp. Most needed fixes.

This affects Callers, Stack, and nearly all the runtime
profiling routines. It does not affect stack copying directly
nor garbage collection.

LGTM=khr
R=khr, bradfitz
CC=golang-codereviews, r
https://golang.org/cl/167060043

10 years agobufio: fix reading of many blank lines in a row
Russ Cox [Thu, 6 Nov 2014 03:50:24 +0000 (22:50 -0500)]
bufio: fix reading of many blank lines in a row

Fixes #9020.

LGTM=bradfitz, r
R=r, bradfitz
CC=golang-codereviews
https://golang.org/cl/170030043

10 years agodoc/go1.4.html: document new subrepo import paths
Russ Cox [Thu, 6 Nov 2014 01:15:48 +0000 (20:15 -0500)]
doc/go1.4.html: document new subrepo import paths

LGTM=r, adg
R=adg, r, 0xjnml, dr.volker.dobler
CC=golang-codereviews
https://golang.org/cl/166980044

10 years agobufio: don't loop generating empty tokens
Rob Pike [Wed, 5 Nov 2014 22:57:46 +0000 (09:57 +1100)]
bufio: don't loop generating empty tokens

The new rules for split functions mean that we are exposed
to the common bug of a function that loops forever at EOF.
Pick these off by shutting down the scanner if too many
consecutive empty tokens are delivered.

Fixes #9020.

LGTM=rsc, adg
R=golang-codereviews, rsc, adg, bradfitz
CC=golang-codereviews
https://golang.org/cl/169970043

10 years ago5g: don't generate reg variables for direct-called functions
Austin Clements [Wed, 5 Nov 2014 20:14:47 +0000 (15:14 -0500)]
5g: don't generate reg variables for direct-called functions

The test intended to skip direct calls when creating
registerization variables was testing p->to.type instead of
p->to.name, so it always failed, causing regopt to create
unnecessary variables for these names.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/169110043

10 years agotest: comment out failing cases from sinit.go
Ian Lance Taylor [Tue, 4 Nov 2014 18:20:35 +0000 (10:20 -0800)]
test: comment out failing cases from sinit.go

One failing case this removes is:

var bytes = []byte("hello, world")
var copy_bytes = bytes

We could handle this in the compiler, but it requires special
case for a variable that is initialized to the value of a
variable that is initialized to a string literal converted to
[]byte.  This seems an unlikely case--it never occurs in the
standrd library--and it seems unnecessary to write the code to
handle it.

If we do want to support this case, one approach is
https://golang.org/cl/171840043.

The other failing cases are of the form

var bx bool
var copy_bx = bx

The compiler used to initialize copy_bx to false.  However,
that led to issue 7665, since bx may be initialized in non-Go
code.  The compiler no longer assumes that bx must be false,
so copy_bx can not be statically initialized.

We can fix these with https://golang.org/cl/169040043
if we also pass -complete to the compiler as part of this
test.  This is OK but it's too late in the release cycle.

Fixes #8746.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/165400043

10 years agogc: abort if given an unknown debug (-d) flag
Austin Clements [Tue, 4 Nov 2014 14:43:37 +0000 (09:43 -0500)]
gc: abort if given an unknown debug (-d) flag

The check for unknown command line debug flags in gc was
incorrect: the loop over debugtab terminates when it reaches a
nil entry, but it was only reporting an error if the parser
had passed the last entry of debugtab (which it never did).
Fix this by reporting the usage error if the loop reaches a
nil entry.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/166110043

10 years agomisc/cgo/test: fix freebsd test failure by moving test to its own package.
Alan Donovan [Mon, 3 Nov 2014 18:41:03 +0000 (13:41 -0500)]
misc/cgo/test: fix freebsd test failure by moving test to its own package.

(The assertion depends on a per-package gensym counter whose
value varies based on what else is in the package.)

LGTM=khr
R=khr, rsc
CC=golang-codereviews
https://golang.org/cl/169930043

10 years agoruntime: make Go and C mallocgc signatures match
Austin Clements [Mon, 3 Nov 2014 18:26:46 +0000 (13:26 -0500)]
runtime: make Go and C mallocgc signatures match

Previously, the flags argument to mallocgc was an int in Go,
but a uint32 in C.  Change the Go type to use uint32 so these
agree.  The largest flag value is 2 (and of course no flag
values are negative), so this won't change anything on little
endian architectures, but it matters on big endian.

LGTM=rsc
R=khr, rsc
CC=golang-codereviews
https://golang.org/cl/169920043

10 years agodoc: document go get -f flag in 1.4 release notes
Andrew Gerrand [Mon, 3 Nov 2014 06:01:17 +0000 (17:01 +1100)]
doc: document go get -f flag in 1.4 release notes

LGTM=r, rsc
R=r, rsc, adg
CC=golang-codereviews
https://golang.org/cl/168890043

10 years agomisc: Increase issue 6997's test timeout to prevent spurious failures.
Benoit Sigoure [Sat, 1 Nov 2014 15:28:09 +0000 (08:28 -0700)]
misc: Increase issue 6997's test timeout to prevent spurious failures.

On heavily loaded build servers, a 5 second timeout is too aggressive,
which causes this test to fail spuriously.

LGTM=iant
R=iant
CC=golang-codereviews, sqweek
https://golang.org/cl/170850043

10 years agoA+C: add Benoit Sigoure (individual CLA)
Ian Lance Taylor [Sat, 1 Nov 2014 15:27:55 +0000 (08:27 -0700)]
A+C: add Benoit Sigoure (individual CLA)

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/164410043

10 years agonet/http: add missing newline in list of leaked goroutines
Ian Lance Taylor [Fri, 31 Oct 2014 17:20:36 +0000 (10:20 -0700)]
net/http: add missing newline in list of leaked goroutines

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/168860044

10 years agodatabase/sql: make TestDrivers not crash on second run
Brad Fitzpatrick [Fri, 31 Oct 2014 16:49:42 +0000 (09:49 -0700)]
database/sql: make TestDrivers not crash on second run

Using -test.cpu=1,1 made it crash before.

Fixes #9024

LGTM=iant
R=adg, iant
CC=golang-codereviews
https://golang.org/cl/169860043

10 years agocmd/go: fixed typo in doc and generator
Gabriel Aszalos [Fri, 31 Oct 2014 16:38:41 +0000 (09:38 -0700)]
cmd/go: fixed typo in doc and generator

LGTM=iant
R=golang-codereviews, iant, bradfitz
CC=golang-codereviews
https://golang.org/cl/163690043

10 years agoA+C: add Gabriel Aszalos (individual CLA)
Ian Lance Taylor [Fri, 31 Oct 2014 16:37:11 +0000 (09:37 -0700)]
A+C: add Gabriel Aszalos (individual CLA)

LGTM=bradfitz
R=adg, bradfitz
CC=golang-codereviews
https://golang.org/cl/162580043

10 years agosync/atomic: fix comment referencing Value.Store's argument name
Brad Fitzpatrick [Fri, 31 Oct 2014 03:48:57 +0000 (00:48 -0300)]
sync/atomic: fix comment referencing Value.Store's argument name

Fixes #9029

LGTM=adg, r
R=r, adg
CC=golang-codereviews
https://golang.org/cl/161630044

10 years agocmd/go: fix minor typo
Nathan P Finch [Thu, 30 Oct 2014 20:20:43 +0000 (13:20 -0700)]
cmd/go: fix minor typo

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/170770043

10 years agoA+C: Nathan P Finch (individual CLA)
Brad Fitzpatrick [Thu, 30 Oct 2014 20:19:29 +0000 (17:19 -0300)]
A+C: Nathan P Finch (individual CLA)

TBR=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/155560045

10 years agoA+C: add Jed Denlea (Fastly corporate CLA)
Brad Fitzpatrick [Thu, 30 Oct 2014 20:15:43 +0000 (13:15 -0700)]
A+C: add Jed Denlea (Fastly corporate CLA)

LGTM=iant
R=golang-codereviews, iant
CC=adg, golang-codereviews
https://golang.org/cl/165170043

10 years agomisc/cgo/test: fix bad C test code that fails on some configurations
Alan Donovan [Thu, 30 Oct 2014 18:08:55 +0000 (14:08 -0400)]
misc/cgo/test: fix bad C test code that fails on some configurations

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/169800043

10 years agocmd/cgo: avoid worklist nondeterminism.
Alan Donovan [Thu, 30 Oct 2014 18:01:14 +0000 (14:01 -0400)]
cmd/cgo: avoid worklist nondeterminism.

+ Regression test.

Fixes #9026.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/162490043

10 years agodoc/go1.4.html: tweak http.Transport.DialTLS wording
Brad Fitzpatrick [Thu, 30 Oct 2014 13:58:31 +0000 (10:58 -0300)]
doc/go1.4.html: tweak http.Transport.DialTLS wording

It doesn't simplify, because it wasn't even possible before.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/164250043

10 years agodoc/go1.4.html: fix typo
Mikio Hara [Thu, 30 Oct 2014 05:15:00 +0000 (14:15 +0900)]
doc/go1.4.html: fix typo

LGTM=adg
R=r, adg
CC=golang-codereviews
https://golang.org/cl/165890043

10 years agotag go1.4beta1
Andrew Gerrand [Thu, 30 Oct 2014 01:33:57 +0000 (12:33 +1100)]
tag go1.4beta1

TBR=rsc
R=r, rsc
CC=golang-codereviews
https://golang.org/cl/164240043

10 years agocmd/objdump: disable test failing on arm5 go1.4beta1
Russ Cox [Thu, 30 Oct 2014 01:02:58 +0000 (21:02 -0400)]
cmd/objdump: disable test failing on arm5

TBR=adg
CC=golang-codereviews
https://golang.org/cl/167890043

10 years agoruntime: change top-most return PC from goexit to goexit+PCQuantum
Russ Cox [Thu, 30 Oct 2014 00:37:44 +0000 (20:37 -0400)]
runtime: change top-most return PC from goexit to goexit+PCQuantum

If you get a stack of PCs from Callers, it would be expected
that every PC is immediately after a call instruction, so to find
the line of the call, you look up the line for PC-1.
CL 163550043 now explicitly documents that.

The most common exception to this is the top-most return PC
on the stack, which is the entry address of the runtime.goexit
function. Subtracting 1 from that PC will end up in a different
function entirely.

To remove this special case, make the top-most return PC
goexit+PCQuantum and then implement goexit in assembly
so that the first instruction can be skipped.

Fixes #7690.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/170720043

10 years agoruntime: make TestCgoExternalThreadPanic run on windows
Alex Brainman [Wed, 29 Oct 2014 23:24:37 +0000 (10:24 +1100)]
runtime: make TestCgoExternalThreadPanic run on windows

LGTM=rsc
R=golang-codereviews, bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/163540043

10 years agodoc/go1.4.html: final library changes
Rob Pike [Wed, 29 Oct 2014 22:35:48 +0000 (15:35 -0700)]
doc/go1.4.html: final library changes
First draft now complete.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/170750043

10 years agocmd/objdump: use cmd/internal/objfile
Russ Cox [Wed, 29 Oct 2014 22:07:24 +0000 (18:07 -0400)]
cmd/objdump: use cmd/internal/objfile

This removes a bunch of ugly duplicate code.
The end goal is to factor the disassembly code
into cmd/internal/objfile too, so that pprof can use it,
but one step at a time.

LGTM=r, iant
R=r, alex.brainman, iant
CC=golang-codereviews
https://golang.org/cl/149400043

10 years agodoc/go1.4.html: gccgo status
Rob Pike [Wed, 29 Oct 2014 20:07:34 +0000 (13:07 -0700)]
doc/go1.4.html: gccgo status

LGTM=iant, cmang
R=cmang, iant, rsc
CC=golang-codereviews
https://golang.org/cl/169760043

10 years agoruntime: fix line number in first stack frame in printed stack trace
Russ Cox [Wed, 29 Oct 2014 19:14:24 +0000 (15:14 -0400)]
runtime: fix line number in first stack frame in printed stack trace

Originally traceback was only used for printing the stack
when an unexpected signal came in. In that case, the
initial PC is taken from the signal and should be used
unaltered. For the callers, the PC is the return address,
which might be on the line after the call; we subtract 1
to get to the CALL instruction.

Traceback is now used for a variety of things, and for
almost all of those the initial PC is a return address,
whether from getcallerpc, or gp->sched.pc, or gp->syscallpc.
In those cases, we need to subtract 1 from this initial PC,
but the traceback code had a hard rule "never subtract 1
from the initial PC", left over from the signal handling days.

Change gentraceback to take a flag that specifies whether
we are tracing a trap.

Change traceback to default to "starting with a return PC",
which is the overwhelmingly common case.

Add tracebacktrap, like traceback but starting with a trap PC.

Use tracebacktrap in signal handlers.

Fixes #7690.

LGTM=iant, r
R=r, iant
CC=golang-codereviews
https://golang.org/cl/167810044

10 years agoruntime: update comment for Callers
Russ Cox [Wed, 29 Oct 2014 19:14:04 +0000 (15:14 -0400)]
runtime: update comment for Callers

Attempt to clear up confusion about how to turn
the PCs reported by Callers into the file and line
number people actually want.

Fixes #7690.

LGTM=r, chris.cs.guy
R=r, chris.cs.guy
CC=golang-codereviews
https://golang.org/cl/163550043

10 years agodoc/go1.4.html: half of the small library changes
Rob Pike [Wed, 29 Oct 2014 15:15:58 +0000 (08:15 -0700)]
doc/go1.4.html: half of the small library changes

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/165090043

10 years agofmt: fix one-letter typo in doc.go
Rob Pike [Wed, 29 Oct 2014 13:53:05 +0000 (06:53 -0700)]
fmt: fix one-letter typo in doc.go
Stupid mistake in previous CL.

TBR=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/166880043

10 years agocmd/objdump: skip extld test on plan9
Russ Cox [Wed, 29 Oct 2014 04:03:17 +0000 (00:03 -0400)]
cmd/objdump: skip extld test on plan9

TBR=iant
CC=golang-codereviews
https://golang.org/cl/164180043

10 years agoruntime: fix windows build
Russ Cox [Wed, 29 Oct 2014 04:02:29 +0000 (00:02 -0400)]
runtime: fix windows build

TBR=austin
CC=golang-codereviews
https://golang.org/cl/167820043

10 years agocmd/gc: fix build - remove unused variables in walkprint
Russ Cox [Wed, 29 Oct 2014 03:45:01 +0000 (23:45 -0400)]
cmd/gc: fix build - remove unused variables in walkprint

TBR=austin
CC=golang-codereviews
https://golang.org/cl/162420043

10 years agocmd/objdump: disassemble local text symbols
Ian Lance Taylor [Wed, 29 Oct 2014 03:25:55 +0000 (23:25 -0400)]
cmd/objdump: disassemble local text symbols

Fixes #8803.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/169720043

10 years agocmd/gc: fix internal compiler error in struct compare
Russ Cox [Wed, 29 Oct 2014 03:22:46 +0000 (23:22 -0400)]
cmd/gc: fix internal compiler error in struct compare

Fixes #9006.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/167800043

10 years agofmt: fix documentation for %g and %G
Rob Pike [Wed, 29 Oct 2014 03:19:03 +0000 (20:19 -0700)]
fmt: fix documentation for %g and %G
It now echoes what strconv.FormatFloat says.

Fixes #9012.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/169730043

10 years agodoc/go1.4.html: GODEBUG and assembler changes
Rob Pike [Wed, 29 Oct 2014 03:12:17 +0000 (20:12 -0700)]
doc/go1.4.html: GODEBUG and assembler changes

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/160660046

10 years agoruntime: add GODEBUG invalidptr setting
Russ Cox [Wed, 29 Oct 2014 01:53:31 +0000 (21:53 -0400)]
runtime: add GODEBUG invalidptr setting

Fixes #8861.
Fixes #8911.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/165780043

10 years agoruntime: fix unrecovered panic on external thread
Russ Cox [Wed, 29 Oct 2014 01:53:09 +0000 (21:53 -0400)]
runtime: fix unrecovered panic on external thread

Fixes #8588.

LGTM=austin
R=austin
CC=golang-codereviews, khr
https://golang.org/cl/159700044

10 years agocmd/gc: avoid use of goprintf
Russ Cox [Wed, 29 Oct 2014 01:52:53 +0000 (21:52 -0400)]
cmd/gc: avoid use of goprintf

goprintf is a printf-like print for Go.
It is used in the code generated by 'defer print(...)' and 'go print(...)'.

Normally print(1, 2, 3) turns into

        printint(1)
        printint(2)
        printint(3)

but defer and go need a single function call to give the runtime;
they give the runtime something like goprintf("%d%d%d", 1, 2, 3).

Variadic functions like goprintf cannot be described in the new
type information world, so we have to replace it.

Replace with a custom function, so that defer print(1, 2, 3) turns
into

        defer func(a1, a2, a3 int) {
                print(a1, a2, a3)
        }(1, 2, 3)

(and then the print becomes three different printints as usual).

Fixes #8614.

LGTM=austin
R=austin
CC=golang-codereviews, r
https://golang.org/cl/159700043

10 years agoos: fix write on Plan 9
David du Colombier [Tue, 28 Oct 2014 21:44:59 +0000 (22:44 +0100)]
os: fix write on Plan 9

In CL 160670043 the write function was changed
so a zero-length write is now allowed. This leads
the ExampleWriter_Init test to fail.

The reason is that Plan 9 preserves message
boundaries, while the os library expects systems
that don't preserve them. We have to ignore
zero-length writes so they will never turn into EOF.

This issue was previously discussed in CL 7406046.

LGTM=bradfitz
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/163510043

10 years agodoc/go1.4.html: breaking compiler change, no plugins in misc
Rob Pike [Tue, 28 Oct 2014 20:49:41 +0000 (13:49 -0700)]
doc/go1.4.html: breaking compiler change, no plugins in misc

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/166850043

10 years agodoc/asm: explain coordination with garbage collector
Russ Cox [Tue, 28 Oct 2014 19:51:06 +0000 (15:51 -0400)]
doc/asm: explain coordination with garbage collector

Also a few other minor changes.

Fixes #8712.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/164150043

10 years agoos: fix build
Russ Cox [Tue, 28 Oct 2014 19:34:50 +0000 (15:34 -0400)]
os: fix build

TBR=crawshaw
CC=golang-codereviews
https://golang.org/cl/162390043

10 years agodoc/go1.4.html: new ports
Rob Pike [Tue, 28 Oct 2014 19:11:34 +0000 (12:11 -0700)]
doc/go1.4.html: new ports

LGTM=rsc, aram, minux
R=golang-codereviews, aram, minux, rsc
CC=golang-codereviews
https://golang.org/cl/162370045

10 years agoos: do not assume syscall i/o funcs return n=0 on error
Russ Cox [Tue, 28 Oct 2014 19:00:13 +0000 (15:00 -0400)]
os: do not assume syscall i/o funcs return n=0 on error

Fixes #9007.

LGTM=iant, r
R=r, iant
CC=golang-codereviews
https://golang.org/cl/160670043

10 years agodoc/go1.4.html: vanity imports and internal packages
Rob Pike [Tue, 28 Oct 2014 17:51:28 +0000 (10:51 -0700)]
doc/go1.4.html: vanity imports and internal packages

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/165800043

10 years agoruntime: add PauseEnd array to MemStats and GCStats
Jens Frederich [Tue, 28 Oct 2014 16:35:25 +0000 (12:35 -0400)]
runtime: add PauseEnd array to MemStats and GCStats

Fixes #8787.

LGTM=rsc
R=rsc, dvyukov
CC=golang-codereviews
https://golang.org/cl/153670043

10 years agosyscall: fix ParseRoutingSockaddr with unexpected submessages
Russ Cox [Tue, 28 Oct 2014 15:35:00 +0000 (11:35 -0400)]
syscall: fix ParseRoutingSockaddr with unexpected submessages

No easy way to test (would have to actually trigger some routing
events from kernel) but the code is clearly wrong as written.
If the header says there is a submessage, we need to at least
skip over its bytes, not just continue to the next iteration.

Fixes #8203.

LGTM=r
R=r
CC=golang-codereviews, mikioh.mikioh, p
https://golang.org/cl/164140044

10 years agocmd/go: add get -f flag
Russ Cox [Tue, 28 Oct 2014 15:14:25 +0000 (11:14 -0400)]
cmd/go: add get -f flag

get -u now checks that remote repo paths match the
ones predicted by the import paths: if you are get -u'ing
rsc.io/pdf, it has to be checked out from the right location.
This is important in case the rsc.io/pdf redirect changes.

In some cases, people have good reasons to use
non-standard remote repos. Add -f flag to allow that.
The f can stand for force or fork, as you see fit.

Fixes #8850.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/164120043

10 years agonet: add test for lookupIPDeadline
Mikio Hara [Tue, 28 Oct 2014 07:20:49 +0000 (16:20 +0900)]
net: add test for lookupIPDeadline

Just to confirm the fix, by typing the follwing:
go test -run=TestLookupIPDeadline -dnsflood or
go test -run=TestLookupIPDeadline -dnsflood -tags netgo

Update #8602

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/166740043

10 years agodoc/go1.4.html: much of the go command's changes
Rob Pike [Tue, 28 Oct 2014 05:47:50 +0000 (22:47 -0700)]
doc/go1.4.html: much of the go command's changes
still need to do internal and import comments

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/160600043

10 years agodoc/go1.4.html: runtime and performance
Rob Pike [Tue, 28 Oct 2014 03:35:34 +0000 (20:35 -0700)]
doc/go1.4.html: runtime and performance

LGTM=adg, rsc
R=golang-codereviews, adg, bradfitz, dave, rsc
CC=golang-codereviews
https://golang.org/cl/164090044

10 years agoruntime: disable fake time on nacl
Russ Cox [Tue, 28 Oct 2014 00:47:15 +0000 (20:47 -0400)]
runtime: disable fake time on nacl

This leaked into the CL I submitted for Minux,
because I was testing it.

TBR=adg
CC=golang-codereviews
https://golang.org/cl/159600044

10 years agosyscall: accept pre-existing directories in nacl zip file
Russ Cox [Tue, 28 Oct 2014 00:45:16 +0000 (20:45 -0400)]
syscall: accept pre-existing directories in nacl zip file

NaCl creates /tmp. This lets the zip file populate it.

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/159600043

10 years agoruntime: add fake time support back.
Shenghou Ma [Tue, 28 Oct 2014 00:35:15 +0000 (20:35 -0400)]
runtime: add fake time support back.
Revived from CL 15690048.

Fixes #5356.

LGTM=rsc
R=adg, dvyukov, rsc
CC=golang-codereviews
https://golang.org/cl/101400043

10 years agodoc/go_mem.html: don't be clever
Rob Pike [Tue, 28 Oct 2014 00:08:50 +0000 (17:08 -0700)]
doc/go_mem.html: don't be clever

Add a short introductory section saying what most Go
programmers really need to know, which is that you
shouldn't have to read this document to understand
the behavior of your program.

LGTM=bradfitz, adg, tracey.brendan, iant, rsc, dsymonds
R=golang-codereviews, bradfitz, tracey.brendan, adg, iant, rsc, dsymonds
CC=golang-codereviews
https://golang.org/cl/158500043

10 years agospec: permit parentheses around builtin function names
Robert Griesemer [Mon, 27 Oct 2014 23:31:15 +0000 (16:31 -0700)]
spec: permit parentheses around builtin function names

Not a language change.

This is simply documenting the status quo which permits
builtin function names to be parenthesized in calls; e.g.,
both

        len(s)
and
        (((len)))(s)

are accepted by all compilers and go/types.

Changed the grammar by merging the details of BuiltinCall
with ordinary Calls. Also renamed the Call production to
Arguments which more clearly identifies that part of the
grammar and also matches better with its counterpart on
the declaration side (Parameters).

The fact that the first argument can be a type (for builtins)
or cannot be a type (for regular function calls) is expressed
in the prose, no need to make the grammar more complicated.

Fixes #9001.

LGTM=iant, r, rsc
R=r, rsc, iant, ken, dave
CC=golang-codereviews
https://golang.org/cl/160570043

10 years agohtml/template: fix build after encoding/js escaping change
Andrew Gerrand [Mon, 27 Oct 2014 23:18:44 +0000 (10:18 +1100)]
html/template: fix build after encoding/js escaping change

TBR=rsc
R=golang-codereviews
CC=golang-codereviews
https://golang.org/cl/159590043

10 years agotest: make maplinear more robust
Russ Cox [Mon, 27 Oct 2014 22:59:02 +0000 (18:59 -0400)]
test: make maplinear more robust

The test just doubled a certain number of times
and then gave up. On a mostly fast but occasionally
slow machine this may never make the test run
long enough to see the linear growth.

Change test to keep doubling until the first round
takes at least a full second, to reduce the effect of
occasional scheduling or other jitter.

The failure we saw had a time for the first round
of around 100ms.

Note that this test still passes once it sees a linear
effect, even with a very small total time.
The timeout here only applies to how long the execution
must be to support a reported failure.

LGTM=khr
R=khr
CC=golang-codereviews, rlh
https://golang.org/cl/164070043

10 years agoencoding/json: encode \t as \t instead of \u0009
Russ Cox [Mon, 27 Oct 2014 22:58:25 +0000 (18:58 -0400)]
encoding/json: encode \t as \t instead of \u0009

Shorter and easier to read form for a common character.

LGTM=bradfitz
R=adg, bradfitz
CC=golang-codereviews, zimmski
https://golang.org/cl/162340043

10 years agodoc/go1.4.html: first pieces of release notes
Rob Pike [Mon, 27 Oct 2014 21:23:24 +0000 (14:23 -0700)]
doc/go1.4.html: first pieces of release notes
Move the release notes into an HTML file.
Start writing the text.

LGTM=rsc
R=golang-codereviews, bradfitz, kamil.kisiel, tracey.brendan, rsc
CC=golang-codereviews
https://golang.org/cl/161350043

10 years agoruntime: fix endianness assumption when decoding ftab
Austin Clements [Mon, 27 Oct 2014 21:12:48 +0000 (17:12 -0400)]
runtime: fix endianness assumption when decoding ftab

The ftab ends with a half functab record consisting only of
the 'entry' field followed by a uint32 giving the offset of
the next table.  Previously, symtabinit assumed it could read
this uint32 as a uintptr.  Since this is unsafe on big endian,
explicitly read the offset as a uint32.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/157660043

10 years agonet: if a DNS lookup times out, forget that it is in flight
Ian Lance Taylor [Mon, 27 Oct 2014 15:46:18 +0000 (08:46 -0700)]
net: if a DNS lookup times out, forget that it is in flight

Before this CL, if the system resolver does a very slow DNS
lookup for a particular host, all subsequent requests for that
host will hang waiting for that lookup to complete.  That is
more or less expected when Dial is called with no deadline.
When Dial has a deadline, though, we can accumulate a large
number of goroutines waiting for that slow DNS lookup.  Try to
avoid this problem by restarting the DNS lookup when it is
redone after a deadline is passed.

This CL also avoids creating an extra goroutine purely to
handle the deadline.

No test because we would have to simulate a slow DNS lookup
followed by a fast DNS lookup.

Fixes #8602.

LGTM=bradfitz
R=bradfitz, mikioh.mikioh
CC=golang-codereviews, r, rsc
https://golang.org/cl/154610044

10 years agomisc/makerelease/windows: fix 404 help URL in installer
Emil Hessman [Mon, 27 Oct 2014 01:43:14 +0000 (12:43 +1100)]
misc/makerelease/windows: fix 404 help URL in installer

ARPHELPLINK yields 404; update the URL.

While here, also prefix the ARPREADME and ARPURLINFOABOUT URL's with the HTTP scheme to make 'em clickable links in the Add or Remove Programs listing.

LGTM=adg
R=golang-codereviews
CC=adg, golang-codereviews
https://golang.org/cl/154580045

10 years agodoc/go_faq.html: fix a couple of nits
Rob Pike [Sun, 26 Oct 2014 18:27:55 +0000 (11:27 -0700)]
doc/go_faq.html: fix a couple of nits
Wrong article, one stylistic point that bothers someone (but not me).

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/156680043

10 years agocmd/go: pass $CGO_LDFLAGS to linker with the "gccgo" toolchain.
Peter Collingbourne [Sat, 25 Oct 2014 17:30:14 +0000 (10:30 -0700)]
cmd/go: pass $CGO_LDFLAGS to linker with the "gccgo" toolchain.

LGTM=iant
R=iant, minux
CC=golang-codereviews, golang-dev
https://golang.org/cl/157460043

10 years agocmd/go: add bzr support for vcs root checking
Gustavo Niemeyer [Fri, 24 Oct 2014 17:49:17 +0000 (15:49 -0200)]
cmd/go: add bzr support for vcs root checking

Complements the logic introduced in CL 147170043.

LGTM=rsc
R=rsc, gustavo
CC=golang-codereviews
https://golang.org/cl/147240043

10 years agodoc/go1.4.txt: unsafe is outside go1 compatibility guarantees
Rob Pike [Fri, 24 Oct 2014 16:52:11 +0000 (09:52 -0700)]
doc/go1.4.txt: unsafe is outside go1 compatibility guarantees

CC=golang-codereviews
https://golang.org/cl/164770043

10 years agounsafe: document that unsafe programs are not protected
Rob Pike [Fri, 24 Oct 2014 16:37:25 +0000 (09:37 -0700)]
unsafe: document that unsafe programs are not protected
The compatibility guideline needs to be clear about this even
though it means adding a clause that was not there from the
beginning. It has always been understood, so this isn't really
a change in policy, just in its expression.

LGTM=bradfitz, gri, rsc
R=golang-codereviews, bradfitz, gri, rsc
CC=golang-codereviews
https://golang.org/cl/162060043

10 years agonet/http/pprof: run GC for /debug/pprof/heap?gc=1
Russ Cox [Fri, 24 Oct 2014 14:58:13 +0000 (10:58 -0400)]
net/http/pprof: run GC for /debug/pprof/heap?gc=1

We force runtime.GC before WriteHeapProfile with -test.heapprofile.
Make it possible to do the same with the HTTP interface.

Some servers only run a GC every few minutes.
On such servers, the heap profile will be a few minutes stale,
which may be too old to be useful.

Requested by private mail.

LGTM=dvyukov
R=dvyukov
CC=golang-codereviews
https://golang.org/cl/161990043

10 years agocmd/gc: synthesize zeroed value for non-assignment context
Russ Cox [Fri, 24 Oct 2014 14:27:39 +0000 (10:27 -0400)]
cmd/gc: synthesize zeroed value for non-assignment context

CL 157910047 introduced code to turn a node representing
a zeroed composite literal into N, the nil Node* pointer
(which represents any zero, not the Go literal nil).

That's great for assignments like x = T{}, but it doesn't work
when T{} is used in a value context like T{}.v or x == T{}.
Fix those.

Should have no effect on performance; confirmed.
The deltas below are noise (compare ns/op):

benchmark                          old ns/op      new ns/op      delta
BenchmarkBinaryTree17              2902919192     2915228424     +0.42%
BenchmarkFannkuch11                2597417605     2630363685     +1.27%
BenchmarkFmtFprintfEmpty           73.7           74.8           +1.49%
BenchmarkFmtFprintfString          196            199            +1.53%
BenchmarkFmtFprintfInt             213            217            +1.88%
BenchmarkFmtFprintfIntInt          336            356            +5.95%
BenchmarkFmtFprintfPrefixedInt     289            294            +1.73%
BenchmarkFmtFprintfFloat           415            416            +0.24%
BenchmarkFmtManyArgs               1281           1271           -0.78%
BenchmarkGobDecode                 10271734       10307978       +0.35%
BenchmarkGobEncode                 8985021        9079442        +1.05%
BenchmarkGzip                      410233227      412266944      +0.50%
BenchmarkGunzip                    102114554      103272443      +1.13%
BenchmarkHTTPClientServer          45297          44993          -0.67%
BenchmarkJSONEncode                19499741       19498489       -0.01%
BenchmarkJSONDecode                76436733       74247497       -2.86%
BenchmarkMandelbrot200             4273814        4307292        +0.78%
BenchmarkGoParse                   4024594        4028937        +0.11%
BenchmarkRegexpMatchEasy0_32       131            135            +3.05%
BenchmarkRegexpMatchEasy0_1K       328            333            +1.52%
BenchmarkRegexpMatchEasy1_32       115            117            +1.74%
BenchmarkRegexpMatchEasy1_1K       931            948            +1.83%
BenchmarkRegexpMatchMedium_32      216            217            +0.46%
BenchmarkRegexpMatchMedium_1K      72669          72857          +0.26%
BenchmarkRegexpMatchHard_32        3818           3809           -0.24%
BenchmarkRegexpMatchHard_1K        121398         121945         +0.45%
BenchmarkRevcomp                   613996550      615145436      +0.19%
BenchmarkTemplate                  93678525       93267391       -0.44%
BenchmarkTimeParse                 414            411            -0.72%
BenchmarkTimeFormat                396            399            +0.76%

Fixes #8947.

LGTM=r
R=r, dave
CC=golang-codereviews
https://golang.org/cl/162130043

10 years agodoc/go1.4: encoding/csv
Russ Cox [Fri, 24 Oct 2014 04:48:34 +0000 (00:48 -0400)]
doc/go1.4: encoding/csv

CC=golang-codereviews
https://golang.org/cl/162140043

10 years agoencoding/csv: for Postgres, unquote empty strings, quote \.
Russ Cox [Fri, 24 Oct 2014 03:44:47 +0000 (23:44 -0400)]
encoding/csv: for Postgres, unquote empty strings, quote \.

In theory both of these lines encode the same three fields:

        a,,c
        a,"",c

However, Postgres defines that when importing CSV, the unquoted
version is treated as NULL (missing), while the quoted version is
treated as a string value (empty string). If the middle field is supposed to
be an integer value, the first line can be imported (NULL is okay), but
the second line cannot (empty string is not).

Postgres's import command (COPY FROM) has an option to force
the unquoted empty to be interpreted as a string but it does not
have an option to force the quoted empty to be interpreted as a NULL.

From http://www.postgresql.org/docs/9.0/static/sql-copy.html:

        The CSV format has no standard way to distinguish a NULL
        value from an empty string. PostgreSQL's COPY handles this
        by quoting. A NULL is output as the NULL parameter string
        and is not quoted, while a non-NULL value matching the NULL
        parameter string is quoted. For example, with the default
        settings, a NULL is written as an unquoted empty string,
        while an empty string data value is written with double
        quotes (""). Reading values follows similar rules. You can
        use FORCE_NOT_NULL to prevent NULL input comparisons for
        specific columns.

Therefore printing the unquoted empty is more flexible for
imports into Postgres than printing the quoted empty.

In addition to making the output more useful with Postgres, not
quoting empty strings makes the output smaller and easier to read.
It also matches the behavior of Microsoft Excel and Google Drive.

Since we are here and making concessions for Postgres, handle this
case too (again quoting the Postgres docs):

        Because backslash is not a special character in the CSV
        format, \., the end-of-data marker, could also appear as a
        data value. To avoid any misinterpretation, a \. data value
        appearing as a lone entry on a line is automatically quoted
        on output, and on input, if quoted, is not interpreted as
        the end-of-data marker. If you are loading a file created by
        another application that has a single unquoted column and
        might have a value of \., you might need to quote that value
        in the input file.

Fixes #7586.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/164760043

10 years agospec: minimal documention of unsafe.Pointer conversions
Robert Griesemer [Thu, 23 Oct 2014 16:45:11 +0000 (09:45 -0700)]
spec: minimal documention of unsafe.Pointer conversions

Per suggestion from rsc as a result of the dicussion of
(abandoned) CL 153110044.

Fixes #7192.

LGTM=r, rsc, iant
R=r, rsc, iant, ken
CC=golang-codereviews
https://golang.org/cl/163050043

10 years agogccgo_install.html: the 4.9 release series supports Go 1.2
Ian Lance Taylor [Thu, 23 Oct 2014 03:41:13 +0000 (20:41 -0700)]
gccgo_install.html: the 4.9 release series supports Go 1.2

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/163760043

10 years agosync: release Pool memory during second and later GCs
Dmitriy Vyukov [Wed, 22 Oct 2014 16:23:49 +0000 (20:23 +0400)]
sync: release Pool memory during second and later GCs

Pool memory was only being released during the first GC after the first Put.

Put assumes that p.local != nil means p is on the allPools list.
poolCleanup (called during each GC) removed each pool from allPools
but did not clear p.local, so each pool was cleared by exactly one GC
and then never cleared again.

This bug was introduced late in the Go 1.3 release cycle.

Fixes #8979.

LGTM=rsc
R=golang-codereviews, bradfitz, r, rsc
CC=golang-codereviews, khr
https://golang.org/cl/162980043

10 years agotest: add more cases to recover.go
Ian Lance Taylor [Wed, 22 Oct 2014 15:06:15 +0000 (08:06 -0700)]
test: add more cases to recover.go

test16 used to fail with gccgo.  The withoutRecoverRecursive
test would have failed in some possible implementations.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/151630043

10 years agoCONTRIBUTORS: add Austin Clements's google.com email (Google CLA)
Russ Cox [Wed, 22 Oct 2014 14:51:30 +0000 (10:51 -0400)]
CONTRIBUTORS: add Austin Clements's google.com email (Google CLA)

LGTM=bradfitz, austin
R=austin
CC=bradfitz, golang-codereviews
https://golang.org/cl/158330045

10 years agoruntime/cgo: encode BLX directly, fixes one clang build error on arm
Dave Cheney [Wed, 22 Oct 2014 01:30:15 +0000 (12:30 +1100)]
runtime/cgo: encode BLX directly, fixes one clang build error on arm

Fixes #8348.

Trying to work around clang's dodgy support for .arch by reverting to the external assembler didn't work out so well. Minux had a much better solution to encode the instructions we need as .word directives which avoids .arch altogether.

I've confirmed with gdb that this form produces the expected machine code

Dump of assembler code for function crosscall_arm1:
   0x00000000 <+0>: push {r4, r5, r6, r7, r8, r9, r10, r11, r12, lr}
   0x00000004 <+4>: mov r4, r0
   0x00000008 <+8>: mov r5, r1
   0x0000000c <+12>: mov r0, r2
   0x00000010 <+16>: blx r5
   0x00000014 <+20>: blx r4
   0x00000018 <+24>: pop {r4, r5, r6, r7, r8, r9, r10, r11, r12, pc}

There is another compilation failure that blocks building Go with clang on arm

# ../misc/cgo/test
# _/home/dfc/go/misc/cgo/test
/tmp/--407b12.s: Assembler messages:
/tmp/--407b12.s:59: Error: selected processor does not support ARM mode `blx r0'
clang: error: assembler command failed with exit code 1 (use -v to see invocation)
FAIL _/home/dfc/go/misc/cgo/test [build failed]

I'll open a new issue for that

LGTM=iant
R=iant, minux
CC=golang-codereviews
https://golang.org/cl/158180047

10 years agomisc/makerelease: set version number in Windows installer
Jens Frederich [Tue, 21 Oct 2014 23:56:26 +0000 (10:56 +1100)]
misc/makerelease: set version number in Windows installer

Set correct version number at Windows installer based on
Go's Mercurial tag.

Name                                     | Version
------------------------------------------------
Go Programming Language amd64 go1.3.3    | 1.3.3
Go Programming Language amd64 go1.2rc3   | 1.2
Go Programming Language amd64 go1.2beta1 | 1.2

Fixes #8239.

LGTM=adg
R=adg, c.emil.hessman, alex.brainman
CC=golang-codereviews
https://golang.org/cl/160950044

10 years agoundo CL 156430044 / 5d69cad4faaf
Dave Cheney [Tue, 21 Oct 2014 23:42:13 +0000 (23:42 +0000)]
undo CL 156430044 / 5d69cad4faaf

Partial undo, changes to ldelf.c retained.

Some platforms are still not working even with the integrated assembler disabled, will have to find another solution.

««« original CL description
cmd/cgo: disable clang's integrated assembler

Fixes #8348.

Clang's internal assembler (introduced by default in clang 3.4) understands the .arch directive, but doesn't change the default value of -march. This causes the build to fail when we use BLX (armv5 and above) when clang is compiled for the default armv4t architecture (which appears to be the default on all the distros I've used).

This is probably a clang bug, so work around it for the time being by disabling the integrated assembler when compiling the cgo assembly shim.

This CL also includes a small change to ldelf.c which was required as clang 3.4 and above generate more weird symtab entries.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/156430044
»»»

LGTM=minux
R=iant, minux
CC=golang-codereviews
https://golang.org/cl/162880044

10 years agoruntime: warn that cputicks() might not be monotonic.
Keith Randall [Tue, 21 Oct 2014 21:46:07 +0000 (14:46 -0700)]
runtime: warn that cputicks() might not be monotonic.

Get rid of gocputicks(), it is no longer used.

LGTM=bradfitz, dave
R=golang-codereviews, bradfitz, dave, minux
CC=golang-codereviews
https://golang.org/cl/161110044

10 years agocmd/ld: fix addstrdata for big-endian systems
Ian Lance Taylor [Tue, 21 Oct 2014 17:10:11 +0000 (10:10 -0700)]
cmd/ld: fix addstrdata for big-endian systems

LGTM=rsc
R=minux, rsc
CC=golang-codereviews
https://golang.org/cl/158280043

10 years agotime: panic with a more helpful error on use of invalid Timer
Brad Fitzpatrick [Tue, 21 Oct 2014 11:26:40 +0000 (13:26 +0200)]
time: panic with a more helpful error on use of invalid Timer

Fixes #8721

LGTM=rsc
R=r, rsc
CC=golang-codereviews
https://golang.org/cl/155620045

10 years agocmd/gc: disallow call of *T method using **T variable
Russ Cox [Tue, 21 Oct 2014 02:04:12 +0000 (22:04 -0400)]
cmd/gc: disallow call of *T method using **T variable

This brings cmd/gc in line with the spec on this question.
It might break existing code, but that code was not conformant
with the spec.

Credit to Rémy for finding the broken code.

Fixes #6366.

LGTM=r
R=golang-codereviews, r
CC=adonovan, golang-codereviews, gri
https://golang.org/cl/129550043

10 years agocompress/gzip: allow stopping at end of first stream
Russ Cox [Tue, 21 Oct 2014 02:03:46 +0000 (22:03 -0400)]
compress/gzip: allow stopping at end of first stream

Allows parsing some file formats that assign special
meaning to which stream data is found in.

Will do the same for compress/bzip2 once this is
reviewed and submitted.

Fixes #6486.

LGTM=nigeltao
R=nigeltao, dan.kortschak
CC=adg, bradfitz, golang-codereviews, r
https://golang.org/cl/159120044