1
0
mirror of https://github.com/golang/go synced 2024-09-25 11:20:13 -06:00
Commit Graph

19239 Commits

Author SHA1 Message Date
Brad Fitzpatrick
9f2e1efd72 net/http/httputil: tell people not to use ClientConn and ServerConn
A very smart developer at Gophercon just asked me to help debug
a problem and I was horrified to learn that he was using httputil's
ClientConn. I forgot ClientConn and ServerConn were even included
in Go 1! They should've been deleted.

Scare people away from using them. The net/http package does
not use them and they're unused, unmaintained and untouched in
4+ years.

LGTM=r
R=r, adg
CC=golang-codereviews
https://golang.org/cl/92790043
2014-04-26 22:14:39 -07:00
Robert Obryk
4c129c083b net: Remove an unmatched unlock of ForkLock
Remove an RUnlock of syscall.ForkLock with no matching RLock.
Holding ForkLock in netFD.dup is unnecessary: dupCloseOnExecOld
locks and unlocks the lock on its own and dupCloseOnExec doesn't
need the ForkLock to be held.

LGTM=iant
R=golang-codereviews, bradfitz, iant
CC=golang-codereviews
https://golang.org/cl/99800044
2014-04-26 19:59:00 -07:00
Rui Ueyama
9d7b9fb7d0 encoding/ascii85: handle non-data bytes correctly
Previously Read wouldn't return once its internal input buffer
is filled with non-data bytes.
Fixes #7875.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/90820043
2014-04-26 19:56:06 -07:00
Robert Hencke
d46134830f src: fix issues found by go vet std
LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/96850043
2014-04-26 19:54:48 -07:00
Brad Fitzpatrick
8409dea8ee os: cap reads and writes to 2GB on Darwin and FreeBSD
Fixes #7812

LGTM=josharian, iant
R=rsc, iant, adg, ruiu, minux.ma, josharian
CC=golang-codereviews
https://golang.org/cl/89900044
2014-04-26 10:34:33 -07:00
Jonathan Allie
7faf72bd0d encoding/gob: handle interface types in isZero() by returning true for nil interfaces.
Fixes #7741.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/96830044
2014-04-26 10:25:16 -06:00
Rob Pike
2674efbdf4 doc/debugging_with_gdb.html: add introductory disclaimer
The instructions in this document are useful but not reliable.
Explain the situation up top.

Fixes #7471.

LGTM=josharian, iant
R=golang-codereviews, josharian, iant
CC=golang-codereviews
https://golang.org/cl/96830045
2014-04-26 10:18:17 -06:00
Robert Hencke
75ba181841 doc/contribute.html: link to wiki for more code review information
(from the discussions on CL 89650044)

LGTM=minux.ma, iant
R=iant, minux.ma
CC=golang-codereviews
https://golang.org/cl/97770043
2014-04-25 20:09:04 -07:00
Brad Fitzpatrick
d0402cb416 net/http/httputil: don't leak goroutines in DumpRequestOut
Fixes #7869

LGTM=dsymonds
R=golang-codereviews
CC=adg, dsymonds, golang-codereviews, rsc
https://golang.org/cl/91770048
2014-04-25 15:19:32 -07:00
Mikio Hara
e419ab6452 net: make WriteMsg{IP,UDP,Unix} return the correct number of bytes transferred
Fixes #7645

LGTM=iant, bradfitz
R=iant, bradfitz
CC=golang-codereviews
https://golang.org/cl/90170046
2014-04-26 06:52:37 +09:00
Robert Griesemer
9144d8752a bufio: make all read functions UnreadByte-friendly
Fixes #7844.

LGTM=crawshaw
R=golang-codereviews, crawshaw
CC=golang-codereviews
https://golang.org/cl/90620045
2014-04-25 09:46:07 -06:00
Brad Fitzpatrick
13ea1fd233 net/http, strings, bytes: fix http race, revert part of Reader behavior change
I fixed this data race regression in two ways: in net/http itself, and also
partially reverting the change from https://golang.org/cl/77580046 .
Previously a Read from a strings.Reader or bytes.Reader returning 0 bytes
would not be a memory write. After 77580046 it was. This reverts that back
in case others depended on that. Also adds tests.

Fixes #7856

LGTM=ruiu, iant
R=iant, ruiu
CC=golang-codereviews, gri
https://golang.org/cl/94740044
2014-04-25 06:44:51 -07:00
Rui Ueyama
f40e574d85 net: fix confusing typo in comment
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/93750043
2014-04-24 12:24:22 -07:00
Rob Pike
59d7aa32ca math/cmpx: change space to tab in the Pow docs for better formatting
Godoc makes it look better this way; before, it all ran together into nonsense.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/90400045
2014-04-22 21:12:15 -07:00
Brad Fitzpatrick
5600572249 os/exec: deflake a test on Linux
Work around buggy(?) Linux /proc filesystem.

Fixes #7808

LGTM=iant
R=golang-codereviews, iant
CC=adg, golang-codereviews
https://golang.org/cl/90400044
2014-04-22 17:13:38 -07:00
Rui Ueyama
7ff8e90eb7 strings: fix off-by-one error in test
Previously it would panic because of out-of-bound access
if s1 is longer than s2.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/90110043
2014-04-21 17:00:27 -07:00
Robert Griesemer
2653386ce8 math/big: fix Int.Exp
Fixes #7814.

LGTM=agl, adonovan
R=agl, adonovan
CC=golang-codereviews
https://golang.org/cl/90080043
2014-04-21 15:54:51 -07:00
Josh Bleecher Snyder
9cddb60d25 net: extend TestVariousDeadlines1Proc timeout
TestVariousDeadlines1Proc was flaky on my system,
failing on about 5% of runs.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/89830045
2014-04-21 13:07:51 -07:00
Mark Zavislak
800d8adf35 runtime: fix typo in error message
LGTM=robert.hencke, iant
R=golang-codereviews, robert.hencke, iant
CC=golang-codereviews
https://golang.org/cl/89760043
2014-04-21 08:55:23 -07:00
Rémy Oudompheng
1332eb5b62 runtime/race: add test for issue 7561.
LGTM=dvyukov
R=rsc, iant, khr, dvyukov
CC=golang-codereviews
https://golang.org/cl/76520045
2014-04-21 17:21:09 +02:00
Alex Brainman
296eeaa78d cmd/nm: do not fail TestNM if symbol has less then 3 columns in nm output
Fixes #7829

LGTM=dave
R=golang-codereviews, aram, dave
CC=golang-codereviews
https://golang.org/cl/89830043
2014-04-21 21:12:18 +10:00
Alex Brainman
6a40d549f1 cmd/nm: disable TestNM on darwin, linux and solaris
Update #7829

LGTM=dave
R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/89810043
2014-04-21 20:36:35 +10:00
Alex Brainman
80e7f97206 cmd/ld: correct addresses in windows pe symbol table
This should have been part of 36eb4a62fbb6,
but I later discovered that addresses are all wrong.
Appropriate test added now.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/89470043
2014-04-21 19:28:02 +10:00
Shenghou Ma
1bb4f37fce runtime, go/build: re-enable cgo on FreeBSD.
Fixes #7331.

LGTM=dave, iant
R=golang-codereviews, dave, gobot, iant
CC=golang-codereviews
https://golang.org/cl/89150043
2014-04-21 00:09:22 -04:00
Shenghou Ma
d31d19765b runtime, cmd/ld, cmd/5l, run.bash: enable external linking on FreeBSD/ARM.
Update #7331

LGTM=dave, iant
R=golang-codereviews, dave, gobot, iant
CC=golang-codereviews
https://golang.org/cl/89520043
2014-04-21 00:08:59 -04:00
Shenghou Ma
9ba153e3e0 lib9: restore argv0 initialization code.
`GOARCH=arm go tool 6c` used to give "<prog>: cannot use 6c with GOARCH=arm"

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/89330043
2014-04-21 00:08:39 -04:00
Shenghou Ma
0a8f5177f6 cmd/go: handle -ccflags in 'go test'
CL 89050043 only allows -ccflags for 'go test', this
CL really handles the flag like the other -??flags.
Many thanks to Dobrosław Żybort for pointing this out.
Fixes #7810 (again).

LGTM=iant, matrixik
R=golang-codereviews, iant, matrixik
CC=golang-codereviews
https://golang.org/cl/89230044
2014-04-21 00:02:21 -04:00
David du Colombier
f187675041 doc/go1.3.html: fix Goexit link
LGTM=minux.ma
R=r, minux.ma
CC=golang-codereviews
https://golang.org/cl/89710043
2014-04-20 20:29:17 +02:00
Jan Ziak
943dc2cb8d cmd/gc: avoid %L in error message
Fixes #7783

LGTM=minux.ma
R=rsc, minux.ma
CC=golang-codereviews
https://golang.org/cl/89290043
2014-04-20 11:02:01 +02:00
David du Colombier
09aeca5c04 include/plan9: make mklibc.rc compatible with 9atom
Since there is no Runemask constant in UTF-8 enum in
9atom, removing the other constants leads to an empty
enum, which is illegal. Thus, we remove enum entirely.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/82660044
2014-04-19 09:55:09 +02:00
Alex Brainman
6e8c7f5bb2 cmd/nm: print symbol sizes for windows pe executables
Fixes #6973

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/88820043
2014-04-19 14:47:20 +10:00
Mike Andrews
7c7aaa4156 cmd/ld: don't delete output binary if not "ordinary" file (redux).
following on CL https://golang.org/cl/76810045 and
issue 7563, i now see there's another "remove(outfile)" a few
dozen lines down that also needs fixing.

LGTM=iant
R=golang-codereviews, iant
CC=0intro, golang-codereviews, r
https://golang.org/cl/89030043
2014-04-18 15:37:55 -07:00
David du Colombier
75b74ea8ff doc/go1.3.html: Plan 9 support
LGTM=aram, r
R=r, aram, bradfitz
CC=golang-codereviews, rsc
https://golang.org/cl/89130045
2014-04-18 21:40:55 +02:00
Rob Pike
0d612a8572 doc/go1.3.html: go test always builds
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/89370043
2014-04-18 11:00:38 -07:00
Lucio De Re
cd4c1f18a1 pkg/reflect/value.go: Correction in comment, the argument is "typ", not "t".
LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/89270043
2014-04-18 08:11:31 -07:00
David du Colombier
ba59375750 doc/go1.3.html: new package debug/plan9obj
LGTM=r
R=r
CC=golang-codereviews, rsc
https://golang.org/cl/86180046
2014-04-18 10:50:06 +02:00
Shenghou Ma
4b9ab7dd69 os: change return variable name for Getwd to avoid confusion
changed (pwd string) to (dir string), as some think pwd means passwd.
Fixes #7811.

LGTM=iant
R=golang-codereviews, iant, bradfitz
CC=golang-codereviews
https://golang.org/cl/89100043
2014-04-17 23:17:15 -04:00
Shenghou Ma
c7d864c4d0 cmd/go: support -ccflags in 'go test'
Fixes #7810.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/89050043
2014-04-17 23:16:11 -04:00
Brad Fitzpatrick
8f76641230 net/http/httputil: include Content-Length in DumpResponse output
Fixes #5357

LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/87910050
2014-04-17 14:03:05 -07:00
Brad Fitzpatrick
c45392bae0 net: fix probabilities in DNS SRV shuffleByWeight
Patch from msolo. Just moving it to a CL.
The test fails before and passes with the fix.

Fixes #7098

LGTM=msolo, rsc
R=rsc, iant, msolo
CC=golang-codereviews
https://golang.org/cl/88900044
2014-04-17 13:28:40 -07:00
Russ Cox
576318c7bd cmd/pack: avoid ./ import in test (fix Windows build)
It is possible to use ./ imports on Windows but it
requires some extra command-line work
('go build' does this automatically, but we can't use 'go build' here).

Instead, use an ordinary import and -I/-L, which are easier to use.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/89040043
2014-04-17 16:25:38 -04:00
Ian Lance Taylor
6524310770 cmd/pack: handle very long lines in pkgdef
LGTM=rsc, bradfitz
R=golang-codereviews, rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/88170049
2014-04-17 11:47:12 -07:00
Volker Dobler
ed88076c64 net/http: allow commas and spaces in cookie values
According to RFC 6265 a cookie value may contain neither
commas nor spaces but such values are very common in the
wild and browsers handle them very well so we'll allow
both commas and spaces.
Values starting or ending in a comma or a space are
sent in the quoted form to prevent missinterpetations.

RFC 6265 conforming values are handled as before and
semicolons, backslashes and double-quotes are still
disallowed.

Fixes #7243

LGTM=nigeltao
R=nigeltao
CC=bradfitz, golang-codereviews
https://golang.org/cl/86050045
2014-04-16 23:01:02 -07:00
Shenghou Ma
f8f34c330c doc/effective_go: mention that b.Write is a shorthand for (&b).Write when b is addressable.
The rewrite is due to Rob.

LGTM=r, bradfitz, josharian
R=golang-codereviews, bradfitz, r, josharian
CC=golang-codereviews
https://golang.org/cl/87410043
2014-04-17 01:40:04 -04:00
Ian Lance Taylor
827aab07b8 cmd/ld: don't pass -rdynamic to external linker if -static is used
Fixes #7800.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/87790051
2014-04-16 20:28:53 -07:00
Shenghou Ma
32dffef098 cmd/gc: fix segfault in isgoconst.
Variables declared with 'var' have no sym->def.

Fixes #7794.

LGTM=rsc
R=golang-codereviews, bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/88360043
2014-04-16 23:12:06 -04:00
Russ Cox
dc370995a8 test: demo for issue 7695
Cgo writes C function declarations pretending every arg is a pointer.
If the C function is deferred, it does not inhibit stack copying on split.
The stack copying code believes the C declaration, possibly misinterpreting
integers as pointers.

Probably the right fix for Go 1.3 is to make deferred C functions inhibit
stack copying.

For Go 1.4 and beyond we probably need to make cgo generate Go code
for 6g here, not C code for 6c.

Update #7695

LGTM=khr
R=khr
CC=golang-codereviews
https://golang.org/cl/83820043
2014-04-16 23:06:37 -04:00
Robert Daniel Kortschak
6277cc3df5 compress/gzip: add Reset method to Reader
Fixes #6364.

LGTM=rsc
R=golang-codereviews, bradfitz, rsc, gobot
CC=golang-codereviews
https://golang.org/cl/13512052
2014-04-16 22:43:44 -04:00
Shenghou Ma
6f25f1d4c9 encoding/json: document Encoder will terminate each JSON value with '\n'
Fixes #7767.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/87420043
2014-04-16 22:42:24 -04:00
Jan Ziak
1d2b71ce83 cmd/gc: fewer errors for wrong argument count
Fixes #7675

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/85040044
2014-04-16 22:42:09 -04:00