Commit Graph

12749 Commits

Author SHA1 Message Date
Brad Fitzpatrick
b2e9f425b9 net/http: fix crash with Transport.CloseIdleConnections
Thanks Michael Lore for the bug report!

Fixes #3266

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5754068
2012-03-09 16:27:32 -08:00
Brad Fitzpatrick
98cfe6770d archive/zip: verify CRC32s in non-streamed files
We should check the CRC32s of files on EOF, even if there's no
data descriptor (in streamed files), as long as there's a non-zero
CRC32 in the file header / TOC.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5794045
2012-03-09 14:45:40 -08:00
Alex Brainman
9fffe45c65 crypto/x509: do not forget to free cert context
R=golang-dev, krautz, rsc
CC=golang-dev
https://golang.org/cl/5783059
2012-03-10 09:35:56 +11:00
Brad Fitzpatrick
3cea4131df archive/zip: write data descriptor signature for OS X; fix bugs reading it
We now always write the "optional" streaming data descriptor
signature, which turns out to be required for OS X.

Also, handle reading the data descriptor with or without the
signature, per the spec's recommendation. Fix data descriptor
reading bugs found in the process.

Fixes #3252

R=golang-dev, alex.brainman, nigeltao, rsc
CC=golang-dev
https://golang.org/cl/5787062
2012-03-09 14:12:02 -08:00
Robert Griesemer
ece0d0e7d2 go/printer: example for Fprint
R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5785057
2012-03-09 13:53:25 -08:00
Shenghou Ma
29199aa4e4 cmd/gc: import path cannot start with slash on Windows
For CL 5756065.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5784065
2012-03-10 05:11:51 +08:00
Shenghou Ma
6d4da06d36 cmd/dist, cmd/go: move CGO_ENABLED from 'go tool dist env' to 'go env'
So that we don't duplicate knowledge about which OS/ARCH combination
        supports cgo.
        Also updated src/run.bash and src/sudo.bash to use 'go env'.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5792055
2012-03-10 03:42:23 +08:00
Jeremy Jackins
1e374502f4 cmd/vet: fix typo in documentation
familiy -> family

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5783061
2012-03-09 11:21:01 -08:00
Robert Griesemer
0d92614c73 C+A: added Jeremy Jackins (Individual CLA)
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5783063
2012-03-09 11:19:10 -08:00
Robert Griesemer
49d2d98697 go/printer, gofmt: nicer formatting of multi-line returns
This affects corner (test) cases only; gofmt -w src misc
doesn't cause any changes.

- added additional test cases
- removed doIndent parameter from printer.valueSpec
  (was always false)
- gofmt -w src misc causes no changes

Fixes #1207.

R=dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5786060
2012-03-09 11:05:50 -08:00
Russ Cox
c9e5600f7d runtime: move runtime.write back to C
It may have to switch stacks, since we are calling
a DLL instead of a system call.

badcallback says where it is, because it is being called
on a Windows stack already.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/5782060
2012-03-09 00:10:34 -05:00
Mikio Hara
26fa1c8248 net: fix typo
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5782063
2012-03-09 11:50:38 +09:00
Andrew Gerrand
08a5d73940 misc/dist: produce a zip file under windows
Updates #3254.

R=golang-dev, bradfitz, alex.brainman
CC=golang-dev
https://golang.org/cl/5783058
2012-03-09 12:57:38 +11:00
Russ Cox
6a19ae74d4 go/build: add NoGoError
R=dsymonds
CC=golang-dev
https://golang.org/cl/5781063
2012-03-08 17:30:45 -05:00
Russ Cox
8a1b3d5a57 runtime: fix windows build
Implement runtime·write, like on the other systems,
and also runtime·badcallback, in assembly to reduce
stack footprint.

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5785055
2012-03-08 15:53:11 -05:00
Brad Fitzpatrick
312ff5b58e cmd/go: document import path meta tag discovery in go help remote
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5787059
2012-03-08 11:31:52 -08:00
Russ Cox
2c46569f57 cmd/go: add env command, use to fix misc/cgo/testso
Fixes 386 build on 64-bit machines.

R=golang-dev, bradfitz, minux.ma
CC=golang-dev
https://golang.org/cl/5785053
2012-03-08 14:28:44 -05:00
Russ Cox
36aa7d4d14 runtime: inline calls to notok
When a very low-level system call that should never fail
does fail, we call notok, which crashes the program.
Often, we are then left with only the program counter as
information about the crash, and it is in notok.
Instead, inline calls to notok (it is just one instruction
on most systems) so that the program counter will
tell us which system call is unhappy.

R=golang-dev, gri, minux.ma, bradfitz
CC=golang-dev
https://golang.org/cl/5792048
2012-03-08 14:03:56 -05:00
Russ Cox
c978a5a3a9 test: skip . files in directory
Xcode generates ._foo.go files.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5786055
2012-03-08 14:03:40 -05:00
Robert Griesemer
56cae1c230 all: gofmt -w -s src misc
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5781058
2012-03-08 10:48:51 -08:00
Brad Fitzpatrick
9fb68a9a0a database/sql{,driver}: add ErrBadConn
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5785043
2012-03-08 10:09:52 -08:00
Francisco Souza
b492bbe0d6 hgignore: ignoring misc/cgo/testso/main instead of /misc/cgo/testso/testso
test.bash does not remove main if the test fails, so it is good to keep main in .hgignore.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5784057
2012-03-08 12:49:23 -05:00
Shenghou Ma
736ff448de doc: various update to command documents
1. consistent usage section (go tool xxx)
        2. reformat cmd/ld document with minor correction
           document which -H flags are valid on which ld
           document -d flag can't be used on Windows.
           document -Hwindowsgui

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/5782043
2012-03-09 01:31:09 +08:00
Francisco Souza
dc57ed8caf misc/cgo: re-enable testso
The test.bash file generates .so file using gcc, builds the executable
using the go tool and then run it with the $LD_LIBRARY_PATH variable
pointing to the directory where the .so file lives.

Fixes #2982.

R=rsc, remyoudompheng
CC=golang-dev
https://golang.org/cl/5788043
2012-03-08 12:13:41 -05:00
Russ Cox
9b73238daa cgo, runtime: diagnose callback on non-Go thread
Before:
$ go run x.go
signal 11 (core dumped)
$

After:
$ go run x.go
runtime: cgo callback on thread not created by Go.
signal 11 (core dumped)
$

For issue 3068.
Not a fix, but as much of a fix as we can do before Go 1.

R=golang-dev, rogpeppe, gri
CC=golang-dev
https://golang.org/cl/5781047
2012-03-08 12:12:40 -05:00
Robert Griesemer
9b7b574edc go/parser: use test harness for short tests
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5782044
2012-03-08 08:53:31 -08:00
Mikkel Krautz
3133b14b30 crypto/x509: allow server gated crypto in windows systemVerify
Also factors out some code into functions to make
systemVerify easier to read.

R=rsc, agl
CC=golang-dev
https://golang.org/cl/5781054
2012-03-08 11:28:04 -05:00
Mikio Hara
dfb1af4b97 cmd/gofmt: fix race in long test
Fixes #3249.

R=rsc
CC=golang-dev
https://golang.org/cl/5792043
2012-03-08 23:56:26 +09:00
Russ Cox
a40065ac68 cmd/godoc: add support for serving templates
doc: convert to use godoc built-in templates

tmpltohtml is gone, to avoid having a second copy of the code.
Instead, godoc -url /doc/go1.html will print the actual HTML
served for that URL.  "make" will generate files named go1.rawhtml
etc, which can be fed through tidy.

It can be hard to tell from the codereview diffs, but all the
tmpl files have been renamed to be html files and then
have "Template": true added.

R=golang-dev, adg, r, gri
CC=golang-dev
https://golang.org/cl/5782046
2012-03-08 08:39:20 -05:00
Russ Cox
e38c5fb23d net: document ReadMsgUnix, WriteMsgUnix
Fixes #3247.

R=golang-dev, jsing
CC=golang-dev
https://golang.org/cl/5784051
2012-03-08 08:36:40 -05:00
Russ Cox
2ee538bc27 time: mention receiver in Unix, UnixNano docs
Fixes #3248.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5784052
2012-03-08 08:32:52 -05:00
Russ Cox
2b64e00f16 cmd/go: rebuild external test package dependencies
Was missing recompilation of packages imported only
by external test packages (package foo_test), primarily
because Root was not set, so those packages looked like
they were from a different Go tree, so they were not
recompiled if they already existed.

Also clean things up so that only one call to computeStale
is needed.

Fixes #3238.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5786048
2012-03-08 08:32:38 -05:00
Andrew Gerrand
5ca13f6378 doc: fix metadata in go_mem.html
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5781053
2012-03-08 22:50:05 +11:00
Andrew Gerrand
52db02bef3 undo CL 5699082 / 6223c9fe432b
We decided not to record installs, for now at least.

««« original CL description
misc/dashboard: record install counts for external packages

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

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5790044
2012-03-08 22:34:59 +11:00
Volker Dobler
d7d1b18a5d fmt: minor tweak of package doc to show headings in godoc
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5781052
2012-03-08 22:22:36 +11:00
Andrew Gerrand
8a146e707c misc/dashboard: remove obsolete package builder code
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5790045
2012-03-08 21:54:46 +11:00
Andrew Gerrand
b6618c118f doc: drop google +1 button from the home page
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5784048
2012-03-08 17:31:20 +11:00
Robert Griesemer
11d8b155ce go_spec: no known implementation differences anymore
R=r, rsc, iant, ken
CC=golang-dev
https://golang.org/cl/5781048
2012-03-07 22:17:40 -08:00
Rob Pike
1cd272d16a doc/go1: template packages have changed since r60
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5787049
2012-03-08 17:15:23 +11:00
Alex Brainman
2b8a7adde8 go/build: do not parse .syso files
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5786049
2012-03-08 17:06:53 +11:00
Robert Griesemer
f3c39d8f2b go/parser: avoid endless loop in case of internal error
Factored the error synchronization code into two functions
syncStmt and syncDecl. Because they may return w/o advancing
the scanner, there is potential for endless loops across
multiple parse functions; typically caused by an incorrect
token list in these functions (e.g., adding token.ELSE to
syncStmt will cause the parser to go into an endless loop
for test/syntax/semi7.go without this mechanism). This would
indicate a compiler bug, exposed only in an error situation
for very specific source files. Added a mechanism to force
scanner advance if an endless loop is detected. As a result,
error recovery will be less good in those cases, but the parser
reported a source error already and at least doesn't get stuck.

R=rsc, rsc
CC=golang-dev
https://golang.org/cl/5784046
2012-03-07 21:28:50 -08:00
Andrew Gerrand
c9836be112 doc: link to go1 and go1compat from docs index
Fixes #3239.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5782049
2012-03-08 16:10:55 +11:00
Andrew Gerrand
70db237169 doc: add go command notes to the Go 1 doc
Fixes #2912.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5783048
2012-03-08 16:09:49 +11:00
Russ Cox
d4fb568e04 cmd/gc: implement len(array) / cap(array) rule
The spec is looser than the current implementation.
The spec edit was made in CL 4444050 (May 2011)
but I never implemented it.

Fixes #3244.

R=ken2
CC=golang-dev
https://golang.org/cl/5785049
2012-03-07 22:43:28 -05:00
Russ Cox
43d71e7d7d cmd/cgo: silence const warnings
Fixes #3152.

R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/5786047
2012-03-07 22:40:32 -05:00
Andrew Gerrand
94f233574b doc: pngcrush and remove old, unused images
R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/5758047
2012-03-08 14:18:28 +11:00
Shenghou Ma
d56e0e7e94 doc: fix freebsd build
Also rename it to test.bash, for naming consistency.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5784045
2012-03-08 12:04:49 +09:00
Russ Cox
9069721b0e cmd/gc: delete old map delete in walk
R=ken2
CC=golang-dev
https://golang.org/cl/5783047
2012-03-07 22:03:35 -05:00
Russ Cox
b0996334c1 go/build, cmd/go: add support for .syso files
.syso files are system objects copied directly
into the package archive.

Fixes #1552.

R=alex.brainman, iant, r, minux.ma, remyoudompheng
CC=golang-dev
https://golang.org/cl/5778043
2012-03-07 22:03:18 -05:00
Andrew Gerrand
cfe007e1b6 doc: link to sub-repositories from reference page
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5752049
2012-03-08 13:36:38 +11:00