1
0
mirror of https://github.com/golang/go synced 2024-11-15 05:00:31 -07:00
Commit Graph

13066 Commits

Author SHA1 Message Date
David Symonds
1489fd1a3e [release-branch.go1] misc/vim: fix :Import insertion heuristic.
««« backport 9bf2225c38eb
misc/vim: fix :Import insertion heuristic.

If a factored import group has a blank line, assume it is dividing
separate groups of imports (e.g. standard library vs. site-specific).
        import (
                "bytes"
                "io"

                "mycorp/package"
        )

The most common case is inserting new standard library imports,
which are usually (stylistically) the first group, so we should drop
"net" in the above example immediately after "io".

Since this logic is getting non-trivial, add a test.

R=golang-dev, minux.ma, franciscossouza
CC=golang-dev
https://golang.org/cl/6445043

»»»
2012-09-22 05:54:17 +10:00
Rob Pike
37401b00bf [release-branch.go1] flag: fix bug in handling of booleans on error
««« backport a36c0344826a
flag: fix bug in handling of booleans on error
Fixes #3869.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6448072

»»»
2012-09-22 05:54:17 +10:00
Shenghou Ma
9ff8d11c31 [release-branch.go1] log/syslog: don't append \n if there is one
««« backport 6556a8d85dd6
log/syslog: don't append \n if there is one
   pkg log already appends a linefeed to the log message,
so log/syslog doesn't need to append another.

R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/6441048

»»»
2012-09-22 05:54:16 +10:00
Alex Brainman
6601acb041 [release-branch.go1] os: move epipecheck from file_posix.go and into file_unix.go to fix windows build
««« backport d127749038e8
os: move epipecheck from file_posix.go and into file_unix.go to fix windows build

R=golang-dev
CC=golang-dev
https://golang.org/cl/6450058

»»»
2012-09-22 05:54:16 +10:00
Dmitriy Vyukov
53299c4326 [release-branch.go1] os: fix data race in epipecheck()
««« backport 8b3bf65c620c
os: fix data race in epipecheck()
Fixes #3860.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6443051

»»»
2012-09-22 05:54:15 +10:00
Ian Lance Taylor
8f41e7cd81 [release-branch.go1] runtime: ignore signal 33 == SIGSETXID on GNU/Linux
««« backport bfa4e1f1027f
runtime: ignore signal 33 == SIGSETXID on GNU/Linux

When a cgo program calls setuid, setgid, etc., the GNU/Linux
pthread library sends signal SIGSETXID to each thread to tell
it to update its UID info.  If Go is permitted to intercept
the default SIGSETXID signal handler, the program will hang.

This patch tells the runtime package to not try to intercept
SIGSETXID on GNU/Linux.  This will be odd if a Go program
wants to try to use that signal, but it means that cgo
programs that call setuid, etc., won't hang.

Fixes #3871.

R=rsc, r, minux.ma, bradfitz
CC=golang-dev
https://golang.org/cl/6455050

»»»
2012-09-22 05:54:14 +10:00
Robert Griesemer
0db8f6814b [release-branch.go1] go/printer: don't crash if ast.FuncType.Params is nil
««« backport 7f6a0510d3c9
go/printer: don't crash if ast.FuncType.Params is nil

The go/ast comment for FuncType.Params says that the field may be nil.
Make sure the printer accepts such a value. The go/parser always sets
the field (to provide parenthesis position information), but a program
creating a Go AST from scatch may not.

Added corresponding test case.

Fixes #3870.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6448060

»»»
2012-09-22 05:54:14 +10:00
Robert Griesemer
c9cf888cd2 [release-branch.go1] A+C: added Andrew Wilkins (individual contributor)
««« backport b22edea8aed4
A+C: added Andrew Wilkins (individual contributor)

R=rsc, minux.ma, iant
CC=golang-dev
https://golang.org/cl/6447050

»»»
2012-09-22 05:54:13 +10:00
Ian Lance Taylor
b222c9e39b [release-branch.go1] cgo: fix declarations in _cgo_export.c
««« backport 6751a0e1a6a4
cgo: fix declarations in _cgo_export.c

Declare crosscall2.  Declare the functions passed to it as
returning void, rather than relying on implicit return type.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/6432060

»»»
2012-09-22 05:54:13 +10:00
Brad Fitzpatrick
a351c67593 [release-branch.go1] testing: allow concurrent use of T and B
««« backport 7a67d277c7e8
testing: allow concurrent use of T and B

Notably, allow concurrent logging and failing.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6453045

»»»
2012-09-22 05:54:12 +10:00
Mikio Hara
6701fa60b6 [release-branch.go1] net: fix comment
««« backport 5a0aafb7fd8d
net: fix comment

RemoteAddr returns not only UDPAddr but IPAddr.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/6401054

»»»
2012-09-22 05:54:12 +10:00
Rob Pike
402d6b1f5f [release-branch.go1] text/template: fix bug in map indexing
««« backport 0748cd92ed76
text/template: fix bug in map indexing
If the key is not present, return value of the type of the element
not the type of the key. Also fix a test that should have caught this case.

Fixes #3850.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6405078

»»»
2012-09-22 05:54:11 +10:00
Rob Pike
74282e400c [release-branch.go1] encoding/gob: revert 6348067, which broke compatibility
««« backport 3357d8d34ab8
encoding/gob: revert 6348067, which broke compatibility
Add commentary to explain better what's going on, but the
code change is a simple one-line reversal to the previous
form.

R=rsc
CC=golang-dev
https://golang.org/cl/6428072

»»»
2012-09-22 05:54:11 +10:00
Andrew Gerrand
d9c11a7164 [release-branch.go1] doc: add two I/O talks to "Talks" section
««« backport ddaabb722563
doc: add two I/O talks to "Talks" section

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6422056

»»»
2012-09-22 05:54:10 +10:00
Patrick Mylund Nielsen
e40fdffc13 [release-branch.go1] encoding/binary: fix typo: ReadVarint returns an int64, not a uint64.
««« backport 2f39e6389d55
encoding/binary: fix typo: ReadVarint returns an int64, not a uint64.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6432062

»»»
2012-09-22 05:54:10 +10:00
Mikio Hara
071933faef [release-branch.go1] net: fix file descriptor leak on FileListener, FileConn and FilePacketConn
««« backport aee5a494a65c
net: fix file descriptor leak on FileListener, FileConn and FilePacketConn

R=golang-dev, dave, r
CC=golang-dev
https://golang.org/cl/6430062

»»»
2012-09-22 05:54:10 +10:00
Ian Lance Taylor
20ce5bfb6a [release-branch.go1] cgo: add -gccgopkgpath option to match gccgo -fgo-pkgpath
««« backport 06e3a4c30dfb
cgo: add -gccgopkgpath option to match gccgo -fgo-pkgpath

R=golang-dev, r, iant
CC=golang-dev
https://golang.org/cl/6416056

»»»
2012-09-22 05:54:09 +10:00
Mikio Hara
9a0e2e63a3 [release-branch.go1] net: fix typo
««« backport 3019a3e15027
net: fix typo

R=golang-dev, bsiegert, r
CC=golang-dev
https://golang.org/cl/6428050

»»»
2012-09-22 05:54:09 +10:00
Rob Pike
5c47098ec8 [release-branch.go1] sync: mention that WaitGroup.Add panics
««« backport 05f9fa32500a
sync: mention that WaitGroup.Add panics
Fixes #3839.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6428053

»»»
2012-09-22 05:54:08 +10:00
Rémy Oudompheng
d88fcebcd8 [release-branch.go1] testing: fix memory blowup when formatting many lines.
««« backport 5e7fd762f356
testing: fix memory blowup when formatting many lines.

Fixes #3830.

R=golang-dev, r
CC=golang-dev, remy
https://golang.org/cl/6373047

»»»
2012-09-22 05:54:08 +10:00
Rob Pike
4d5ce93cb9 [release-branch.go1] faq: add status section
««« backport 2819b5a4f07d
faq: add status section
Fixes #3822.

R=golang-dev, r, dsymonds, minux.ma, adg
CC=golang-dev
https://golang.org/cl/6395043

»»»
2012-09-22 05:54:07 +10:00
Adam Langley
920cc5211e [release-branch.go1] A+C: Peter Armitage (individual CLA)
««« backport 0423072b54f2
A+C: Peter Armitage (individual CLA)

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6392065

»»»
2012-09-22 05:54:07 +10:00
Nigel Tao
d74aea6fdc [release-branch.go1] compress/flate: fix panic when nlit is out of bounds.
««« backport ecd688de20fb
compress/flate: fix panic when nlit is out of bounds.

Fixes #3815.

R=r
CC=golang-dev
https://golang.org/cl/6352109

»»»
2012-09-22 05:54:06 +10:00
Benny Siegert
34be79e078 [release-branch.go1] os: add missing full stop in comment
««« backport c61c67c7b924
os: add missing full stop in comment

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6399047

»»»
2012-09-22 05:54:06 +10:00
Rémy Oudompheng
aa3ca5f6d7 [release-branch.go1] cmd/gc: reject use of ... with multiple-valued expressions.
««« backport 6d5faedd95bc
cmd/gc: reject use of ... with multiple-valued expressions.

Fixes #3334.

R=golang-dev, r
CC=golang-dev, remy
https://golang.org/cl/6350103

»»»
2012-09-22 05:54:05 +10:00
Rémy Oudompheng
705534bd30 [release-branch.go1] cmd/gc: avoid an internal error on invalid type switch.
««« backport 254232c99b3e
cmd/gc: avoid an internal error on invalid type switch.

The error was caused by a call to implements() even when
the type switch variable was not an interface.

Fixes #3786.

R=golang-dev, r
CC=golang-dev, remy
https://golang.org/cl/6354102

»»»
2012-09-22 05:54:05 +10:00
Rémy Oudompheng
ca64251832 [release-branch.go1] cmd/gc: fix error message for type errors involving conversions.
««« backport a281d4bd1ba6
cmd/gc: fix error message for type errors involving conversions.

Fixes #3818.

R=golang-dev, rsc, r
CC=golang-dev, remy
https://golang.org/cl/6352106

»»»
2012-09-22 05:54:04 +10:00
Andrew Gerrand
939e2b572d [release-branch.go1] encoding/gob: fix check for short input in slice decode 2012-09-22 05:54:04 +10:00
Rémy Oudompheng
9a1209a215 [release-branch.go1] spec: correct typo in string conversion examples.
««« backport 65de4b905541
spec: correct typo in string conversion examples.

R=golang-dev, dave, r
CC=golang-dev, remy
https://golang.org/cl/6378046

»»»
2012-09-22 05:54:03 +10:00
Adam Langley
9dec2eb42a [release-branch.go1] crypto/rsa: left-pad PKCS#1 v1.5 outputs.
««« backport 46ca86e70e96
crypto/rsa: left-pad PKCS#1 v1.5 outputs.

OpenSSL requires that RSA signatures be exactly the same byte-length
as the modulus. Currently it'll reject ~1/256 of our signatures: those
that end up a byte shorter.

Fixes #3796.

R=golang-dev, edsrzf, r
CC=golang-dev
https://golang.org/cl/6352093

»»»
2012-09-22 05:54:03 +10:00
Dave Cheney
530d9535c8 [release-branch.go1] website: various html fixes
««« backport 744f0397f41a
website: various html fixes

Fixes #3424.

R=fullung, adg
CC=golang-dev
https://golang.org/cl/6343088

»»»
2012-09-22 05:54:02 +10:00
Adam Langley
d251529231 [release-branch.go1] crypto/x509: exempt broken Entrust certificate from checks.
««« backport 8241ffc8686e
crypto/x509: exempt broken Entrust certificate from checks.

Entrust have issued a root certificate that's not marked as valid for
signing certificates.

This results in Go programs failing to validate certificates that
chain up to this root (i.e. gateway.push.apple.com:2195).

Although this is clearly a mistake on Entrust's part, it seems that we
will have to bodge around it.

R=golang-dev, dave, r
CC=golang-dev
https://golang.org/cl/6346064

»»»
2012-09-22 05:54:02 +10:00
David G. Andersen
0a128f203e [release-branch.go1] pkg: Removing duplicated words ("of of", etc.), mostly from comments.
««« backport ce3a981ad1ef
pkg: Removing duplicated words ("of of", etc.), mostly from comments.

Ran 'double.pl' on the pkg tree to identify doubled words.
One change to an error string return in x509;  the rest are in comments.
Thanks to Matt Jibson for the idea.

R=golang-dev, bsiegert
CC=golang-dev
https://golang.org/cl/6344089

»»»
2012-09-22 05:54:01 +10:00
Matt Jibson
ba2a1df948 [release-branch.go1] A+C: correct Matt Jibson
««« backport 63dae3ba6a6d
A+C: correct Matt Jibson

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6344088

»»»
2012-09-22 05:54:01 +10:00
Matthew William Jibson
e2541bf319 [release-branch.go1] doc: various "the the" and other typos
««« backport 74c5c02910de
doc: various "the the" and other typos

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6355076

»»»
2012-09-22 05:54:01 +10:00
David Symonds
4662a76477 [release-branch.go1] A+C: Matthew Jibson (individual CLA).
««« backport 9349fc3302f5
A+C: Matthew Jibson (individual CLA).

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/6349082

»»»
2012-09-22 05:54:00 +10:00
Shenghou Ma
171e72bf28 [release-branch.go1] misc/chrome/gophertool: fix manifest
««« backport 100ddb84c85d
misc/chrome/gophertool: fix manifest
according to http://code.google.com/chrome/extensions/browserAction.html,
it should use "default_popup" instead of "popup".

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6349077

»»»
2012-09-22 05:53:59 +10:00
Robert Griesemer
40b5d5481a [release-branch.go1] reflect: reflect.Zero results are neither addressable nor settable
««« backport 21130d62eeb0
reflect: reflect.Zero results are neither addressable nor settable

This could be deduced from "The Laws of Reflection" but it seems
worthwhile highlighting it.

R=r
CC=golang-dev
https://golang.org/cl/6350073

»»»
2012-09-22 05:53:59 +10:00
Rob Pike
ecd62d606a [release-branch.go1] encoding/gob: fix bug in Register
««« backport c89f17a9ff4f
encoding/gob: fix bug in Register
The old code added a star but did not indirect the reflect.Type.

R=bradfitz
CC=golang-dev
https://golang.org/cl/6348067

»»»
2012-09-22 05:53:58 +10:00
Shenghou Ma
7d1ddf2b28 [release-branch.go1] doc/debugging_with_gdb: mention how to disable gc optimization
««« backport be7e338a8960
doc/debugging_with_gdb: mention how to disable gc optimization

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6353055

»»»
2012-09-22 05:53:58 +10:00
David G. Andersen
4b3a35b979 [release-branch.go1] math/big: Remove unnecessary test from nat.go multiplication
««« backport c533f48701cb
math/big: Remove unnecessary test from nat.go multiplication
The switch at the beginning of the function already ensures n > 1,
so testing for n < 2 is redundant.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/6350051

»»»
2012-09-22 05:53:57 +10:00
Shenghou Ma
759c410691 [release-branch.go1] image: fix doc typo
««« backport 042bac4d6b6e
image: fix doc typo
     Fixes #3789.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6357058

»»»
2012-09-22 05:53:57 +10:00
Shenghou Ma
f98661e77e [release-branch.go1] cmd/gc: add missing case for OCOM in defaultlit()
««« backport b5c4f411a852
cmd/gc: add missing case for OCOM in defaultlit()
        Fixes #3765.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6349064

»»»
2012-09-22 05:53:56 +10:00
Amir Mohammad Saied
731bbfef3b [release-branch.go1] cmd/go: httpGet function does not use global variable httpClient
««« backport 650544a058e9
cmd/go: httpGet function does not use global variable httpClient

No change, just for consistency.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6346048

»»»
2012-09-22 05:53:56 +10:00
Brad Fitzpatrick
9786db83e9 [release-branch.go1] net/http: ignore malicious or dumb Range requests
««« backport d32138d8d05f
net/http: ignore malicious or dumb Range requests

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6356050

»»»
2012-09-22 05:53:56 +10:00
Pieter Droogendijk
df2bb18fae [release-branch.go1] cmd/dist: Make windows.c's fatal() print to stderr
««« backport 3f7501fdb220
cmd/dist: Make windows.c's fatal() print to stderr

Generating env.bat using dist env -wp > env.bat failed silently
if case of an error, because the message was redirected to env.bat.
Verbose messages still go to stdout, causing problems, but that's
a seperate change.
Made errprintf() identical to xprintf(), except for the output handle.
Yes, it's duplicate code, but most of the function is unpacking
the argument list and preparing it for WriteFile(), which has to be
done anyway.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/6343047

»»»
2012-09-22 05:53:55 +10:00
Jean-Marc Eurin
e1092f2746 [release-branch.go1] misc/emacs: Fix the gofmt patching when the TMPDIR is not the default.
««« backport c5f564efc620
misc/emacs: Fix the gofmt patching when the TMPDIR is not the default.

The previous code assumed the gofmt output referred to /tmp but
that's not true if TMPDIR points somewhere else (like on Macs).
Fixes #3782.

R=sameer
CC=golang-dev
https://golang.org/cl/6346050

»»»
2012-09-22 05:53:55 +10:00
Brad Fitzpatrick
118f2163bc [release-branch.go1] net/http: support multiple byte ranges in ServeContent
««« backport 070604630d24
net/http: support multiple byte ranges in ServeContent

Fixes #3784

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6351052

»»»
2012-09-22 05:53:54 +10:00
Andrey Mirtchovski
e3bc1e4206 [release-branch.go1] net/http: Fix a verb-tense mismatch and a typo in documentation.
««« backport f8a77e2b7d0b
net/http: Fix a verb-tense mismatch and a typo in documentation.

R=bradfitz
CC=golang-dev
https://golang.org/cl/6357049

»»»
2012-09-22 05:53:54 +10:00
Robert Griesemer
6263484de5 [release-branch.go1] go spec: clean up section on selectors
««« backport eb24cee7f21b
go spec: clean up section on selectors

- point out difference between selectors and qualified identifiers
- differentiate between illegal selectors and run-time panics
- use "indirect" as opposed to "dereference" consistently
- add extra links

Fixes #3779.

R=r, rsc, iant, ken
CC=golang-dev
https://golang.org/cl/6326059

»»»
2012-09-22 05:53:53 +10:00