]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agobuild: update Makefile to track source code dependencies better
Shenghou Ma [Mon, 12 Mar 2012 19:31:11 +0000 (03:31 +0800)]
build: update Makefile to track source code dependencies better
      Also update .hgignore to ignore y.output.

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

13 years agogc: correct comment in runtime.go
Shenghou Ma [Mon, 12 Mar 2012 19:24:13 +0000 (03:24 +0800)]
gc: correct comment in runtime.go

R=rsc, iant
CC=golang-dev
https://golang.org/cl/5777057

13 years agocmd/go: allow ssh tunnelled bzr, git and svn
Ingo Oeser [Mon, 12 Mar 2012 18:41:01 +0000 (14:41 -0400)]
cmd/go: allow ssh tunnelled bzr, git and svn

This is often used in private hosting and collaborating environments.

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

13 years agocodereview: fix for Mercurial 2.1
Russ Cox [Mon, 12 Mar 2012 18:39:44 +0000 (14:39 -0400)]
codereview: fix for Mercurial 2.1

Mercurial: the Python of version control systems.
Python: the Mercurial of programming languages.

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

13 years agohtml/template: doc nit
Russ Cox [Mon, 12 Mar 2012 18:26:10 +0000 (14:26 -0400)]
html/template: doc nit

Execute's data is untrusted regardless of package.

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

13 years agoA+C: add Ingo Oeser (individual CLA)
Russ Cox [Mon, 12 Mar 2012 18:25:52 +0000 (14:25 -0400)]
A+C: add Ingo Oeser (individual CLA)

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

13 years agonet/http: return appropriate errors from ReadRequest
Brad Fitzpatrick [Mon, 12 Mar 2012 17:42:25 +0000 (10:42 -0700)]
net/http: return appropriate errors from ReadRequest

Fixes #3298

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

13 years agocmd/godoc: fix directory read
Russ Cox [Mon, 12 Mar 2012 17:10:37 +0000 (13:10 -0400)]
cmd/godoc: fix directory read

Undo CL 5783076 and apply correct fix.

The /doc hack is wrong.  The code to handle this case was
already there and just needs a simple fix:

  // We didn't find any directories containing Go files.
  // If some directory returned successfully, use that.
- if len(all) == 0 && first != nil {
+ if !haveGo {
  for _, d := range first {
  haveName[d.Name()] = true
  all = append(all, d)

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

13 years agocmd/go: stop using $GOROOT and $GOBIN in script output
Russ Cox [Mon, 12 Mar 2012 16:39:31 +0000 (12:39 -0400)]
cmd/go: stop using $GOROOT and $GOBIN in script output

They were necessary to produce a canonical script
when we checked in build scripts, but now they're just
getting in the way.

Fixes #3279.

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

13 years agoarchive/tar: catch short writes.
David Symonds [Mon, 12 Mar 2012 06:33:35 +0000 (17:33 +1100)]
archive/tar: catch short writes.

Also make error messages consistent throughout.

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

13 years agomisc/dist: use archive/tar to generate tarballs
Brad Fitzpatrick [Mon, 12 Mar 2012 06:07:38 +0000 (23:07 -0700)]
misc/dist: use archive/tar to generate tarballs

For people untarring with -p or as root, preserving file permissions.
This way we don't make tars owned by adg/eng or adg/staff or whatever
machine Andrew was on. Instead, we always build tarballs owned by predictable
users.

Except archive/tar doesn't seem to work.

Updates #3209.

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

13 years agocmd/godoc: always include /doc files in union filesystems
Andrew Gerrand [Mon, 12 Mar 2012 04:55:39 +0000 (15:55 +1100)]
cmd/godoc: always include /doc files in union filesystems

Makes Path rewrites work, as the metadata was never being scanned.

Fixes #3282.

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

13 years agomisc/dist: use archive/zip, seek out windows deps, add --upload flag
Brad Fitzpatrick [Mon, 12 Mar 2012 04:02:40 +0000 (21:02 -0700)]
misc/dist: use archive/zip, seek out windows deps, add --upload flag

Use archive/zip instead of 7z on Windows.

Look for all Windows deps before starting build, and include looking
for them in their common locations instead of making users update
their PATHs.

Add an --upload flag that, if set to false, doesn't require credential
files.

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

13 years agocrypto/tls, fmt: print fixes
Robert Hencke [Mon, 12 Mar 2012 03:04:45 +0000 (12:04 +0900)]
crypto/tls, fmt: print fixes

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

13 years agocmd/vet: little tweak to tagged literal script to get it closer to drop-in format.
David Symonds [Mon, 12 Mar 2012 02:50:25 +0000 (13:50 +1100)]
cmd/vet: little tweak to tagged literal script to get it closer to drop-in format.

This is a minor change that made it easier for me; if you hate it I can drop it.

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

13 years agomisc/dist: minimum target requirement is 10.6 for Darwin
Shenghou Ma [Mon, 12 Mar 2012 02:20:25 +0000 (13:20 +1100)]
misc/dist: minimum target requirement is 10.6 for Darwin
     As we've dropped support for Mac OS X 10.5, I think the generated .pkg
     should reflect that decision.
     But this CL make it impossible to generate pkg on Mac OS X 10.6, at least
     for me.

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

13 years agocmd/api: work on Windows again, and make gccgo files work a bit more
Brad Fitzpatrick [Mon, 12 Mar 2012 00:55:15 +0000 (17:55 -0700)]
cmd/api: work on Windows again, and make gccgo files work a bit more

handle string and []byte conversions.

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

13 years agocmd/api: set compiler for all build contexts.
David Symonds [Mon, 12 Mar 2012 00:25:38 +0000 (11:25 +1100)]
cmd/api: set compiler for all build contexts.

The generated syscall files for Windows are still breaking "go tool api"
(unknown function []byte); I'll look at fixing that separately.

Fixes #3285.

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

13 years agocmd/go: local import fixes
Russ Cox [Sun, 11 Mar 2012 19:53:42 +0000 (15:53 -0400)]
cmd/go: local import fixes

1) The -D argument should always be a pseudo-import path,
like _/Users/rsc/foo/bar, never a standard import path,
because we want local imports to always resolve to pseudo-paths.

2) Disallow local imports in non-local packages.  Otherwise
everything works but you get two copies of a package
(the real one and the "local" one) in your binary.

R=golang-dev, bradfitz, yiyu.jgl
CC=golang-dev
https://golang.org/cl/5787055

13 years agodatabase/sql: ensure Stmts are correctly closed.
Gwenael Treguier [Sat, 10 Mar 2012 23:21:44 +0000 (15:21 -0800)]
database/sql: ensure Stmts are correctly closed.

To make sure that there is no resource leak,
I suggest to fix the 'fakedb' driver such as it fails when any
Stmt is not closed.
First, add a check in fakeConn.Close().
Then, fix all missing Stmt.Close()/Rows.Close().
I am not sure that the strategy choose in fakeConn.Prepare/prepare* is ok.
The weak point in this patch is the change in Tx.Query:
  - Tests pass without this change,
  - I found it by manually analyzing the code,
  - I just try to make Tx.Query look like DB.Query.

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

13 years agodoc: fix typo in contribute.html
Jeremy Jackins [Sat, 10 Mar 2012 23:13:34 +0000 (15:13 -0800)]
doc: fix typo in contribute.html

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

13 years agoA+C: Add Gwenael Treguier (Individual CLA)
Brad Fitzpatrick [Sat, 10 Mar 2012 22:48:00 +0000 (14:48 -0800)]
A+C: Add Gwenael Treguier (Individual CLA)

R=golang-dev, wcn
CC=golang-dev
https://golang.org/cl/5777052

13 years agodatabase/sql: fix double connection free on Stmt.Query error
Brad Fitzpatrick [Sat, 10 Mar 2012 18:00:02 +0000 (10:00 -0800)]
database/sql: fix double connection free on Stmt.Query error

In a transaction, on a Stmt.Query error, it was possible for a
connection to be added to a db's freelist twice. Should use
the local releaseConn function instead.

Thanks to Gwenael Treguier for the failing test.

Also in this CL: propagate driver errors through releaseConn
into *DB.putConn, which conditionally ignores the freelist
addition if the driver signaled ErrBadConn, introduced in a
previous CL.

R=golang-dev, gary.burd
CC=golang-dev
https://golang.org/cl/5798049

13 years agonet/mail: close minor TODO that was waiting on a 6g bug fix.
David Symonds [Sat, 10 Mar 2012 08:02:52 +0000 (19:02 +1100)]
net/mail: close minor TODO that was waiting on a 6g bug fix.

R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5796050

13 years agonet/http: fix crash with Transport.CloseIdleConnections
Brad Fitzpatrick [Sat, 10 Mar 2012 00:27:32 +0000 (16:27 -0800)]
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

13 years agoarchive/zip: verify CRC32s in non-streamed files
Brad Fitzpatrick [Fri, 9 Mar 2012 22:45:40 +0000 (14:45 -0800)]
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

13 years agocrypto/x509: do not forget to free cert context
Alex Brainman [Fri, 9 Mar 2012 22:35:56 +0000 (09:35 +1100)]
crypto/x509: do not forget to free cert context

R=golang-dev, krautz, rsc
CC=golang-dev
https://golang.org/cl/5783059

13 years agoarchive/zip: write data descriptor signature for OS X; fix bugs reading it
Brad Fitzpatrick [Fri, 9 Mar 2012 22:12:02 +0000 (14:12 -0800)]
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

13 years agogo/printer: example for Fprint
Robert Griesemer [Fri, 9 Mar 2012 21:53:25 +0000 (13:53 -0800)]
go/printer: example for Fprint

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

13 years agocmd/gc: import path cannot start with slash on Windows
Shenghou Ma [Fri, 9 Mar 2012 21:11:51 +0000 (05:11 +0800)]
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

13 years agocmd/dist, cmd/go: move CGO_ENABLED from 'go tool dist env' to 'go env'
Shenghou Ma [Fri, 9 Mar 2012 19:42:23 +0000 (03:42 +0800)]
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

13 years agocmd/vet: fix typo in documentation
Jeremy Jackins [Fri, 9 Mar 2012 19:21:01 +0000 (11:21 -0800)]
cmd/vet: fix typo in documentation
familiy -> family

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

13 years agoC+A: added Jeremy Jackins (Individual CLA)
Robert Griesemer [Fri, 9 Mar 2012 19:19:10 +0000 (11:19 -0800)]
C+A: added Jeremy Jackins (Individual CLA)

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

13 years agogo/printer, gofmt: nicer formatting of multi-line returns
Robert Griesemer [Fri, 9 Mar 2012 19:05:50 +0000 (11:05 -0800)]
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

13 years agoruntime: move runtime.write back to C
Russ Cox [Fri, 9 Mar 2012 05:10:34 +0000 (00:10 -0500)]
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

13 years agonet: fix typo
Mikio Hara [Fri, 9 Mar 2012 02:50:38 +0000 (11:50 +0900)]
net: fix typo

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

13 years agomisc/dist: produce a zip file under windows
Andrew Gerrand [Fri, 9 Mar 2012 01:57:38 +0000 (12:57 +1100)]
misc/dist: produce a zip file under windows

Updates #3254.

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

13 years agogo/build: add NoGoError
Russ Cox [Thu, 8 Mar 2012 22:30:45 +0000 (17:30 -0500)]
go/build: add NoGoError

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

13 years agoruntime: fix windows build
Russ Cox [Thu, 8 Mar 2012 20:53:11 +0000 (15:53 -0500)]
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

13 years agocmd/go: document import path meta tag discovery in go help remote
Brad Fitzpatrick [Thu, 8 Mar 2012 19:31:52 +0000 (11:31 -0800)]
cmd/go: document import path meta tag discovery in go help remote

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

13 years agocmd/go: add env command, use to fix misc/cgo/testso
Russ Cox [Thu, 8 Mar 2012 19:28:44 +0000 (14:28 -0500)]
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

13 years agoruntime: inline calls to notok
Russ Cox [Thu, 8 Mar 2012 19:03:56 +0000 (14:03 -0500)]
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

13 years agotest: skip . files in directory
Russ Cox [Thu, 8 Mar 2012 19:03:40 +0000 (14:03 -0500)]
test: skip . files in directory

Xcode generates ._foo.go files.

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

13 years agoall: gofmt -w -s src misc
Robert Griesemer [Thu, 8 Mar 2012 18:48:51 +0000 (10:48 -0800)]
all: gofmt -w -s src misc

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

13 years agodatabase/sql{,driver}: add ErrBadConn
Brad Fitzpatrick [Thu, 8 Mar 2012 18:09:52 +0000 (10:09 -0800)]
database/sql{,driver}: add ErrBadConn

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

13 years agohgignore: ignoring misc/cgo/testso/main instead of /misc/cgo/testso/testso
Francisco Souza [Thu, 8 Mar 2012 17:49:23 +0000 (12:49 -0500)]
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

13 years agodoc: various update to command documents
Shenghou Ma [Thu, 8 Mar 2012 17:31:09 +0000 (01:31 +0800)]
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

13 years agomisc/cgo: re-enable testso
Francisco Souza [Thu, 8 Mar 2012 17:13:41 +0000 (12:13 -0500)]
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

13 years agocgo, runtime: diagnose callback on non-Go thread
Russ Cox [Thu, 8 Mar 2012 17:12:40 +0000 (12:12 -0500)]
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

13 years agogo/parser: use test harness for short tests
Robert Griesemer [Thu, 8 Mar 2012 16:53:31 +0000 (08:53 -0800)]
go/parser: use test harness for short tests

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

13 years agocrypto/x509: allow server gated crypto in windows systemVerify
Mikkel Krautz [Thu, 8 Mar 2012 16:28:04 +0000 (11:28 -0500)]
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

13 years agocmd/gofmt: fix race in long test
Mikio Hara [Thu, 8 Mar 2012 14:56:26 +0000 (23:56 +0900)]
cmd/gofmt: fix race in long test

Fixes #3249.

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

13 years agocmd/godoc: add support for serving templates
Russ Cox [Thu, 8 Mar 2012 13:39:20 +0000 (08:39 -0500)]
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

13 years agonet: document ReadMsgUnix, WriteMsgUnix
Russ Cox [Thu, 8 Mar 2012 13:36:40 +0000 (08:36 -0500)]
net: document ReadMsgUnix, WriteMsgUnix

Fixes #3247.

R=golang-dev, jsing
CC=golang-dev
https://golang.org/cl/5784051

13 years agotime: mention receiver in Unix, UnixNano docs
Russ Cox [Thu, 8 Mar 2012 13:32:52 +0000 (08:32 -0500)]
time: mention receiver in Unix, UnixNano docs

Fixes #3248.

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

13 years agocmd/go: rebuild external test package dependencies
Russ Cox [Thu, 8 Mar 2012 13:32:38 +0000 (08:32 -0500)]
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

13 years agodoc: fix metadata in go_mem.html
Andrew Gerrand [Thu, 8 Mar 2012 11:50:05 +0000 (22:50 +1100)]
doc: fix metadata in go_mem.html

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

13 years agoundo CL 5699082 / 6223c9fe432b
Andrew Gerrand [Thu, 8 Mar 2012 11:34:59 +0000 (22:34 +1100)]
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

13 years agofmt: minor tweak of package doc to show headings in godoc
Volker Dobler [Thu, 8 Mar 2012 11:22:36 +0000 (22:22 +1100)]
fmt: minor tweak of package doc to show headings in godoc

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

13 years agomisc/dashboard: remove obsolete package builder code
Andrew Gerrand [Thu, 8 Mar 2012 10:54:46 +0000 (21:54 +1100)]
misc/dashboard: remove obsolete package builder code

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

13 years agodoc: drop google +1 button from the home page
Andrew Gerrand [Thu, 8 Mar 2012 06:31:20 +0000 (17:31 +1100)]
doc: drop google +1 button from the home page

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

13 years agogo_spec: no known implementation differences anymore
Robert Griesemer [Thu, 8 Mar 2012 06:17:40 +0000 (22:17 -0800)]
go_spec: no known implementation differences anymore

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

13 years agodoc/go1: template packages have changed since r60
Rob Pike [Thu, 8 Mar 2012 06:15:23 +0000 (17:15 +1100)]
doc/go1: template packages have changed since r60

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

13 years agogo/build: do not parse .syso files
Alex Brainman [Thu, 8 Mar 2012 06:06:53 +0000 (17:06 +1100)]
go/build: do not parse .syso files

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

13 years agogo/parser: avoid endless loop in case of internal error
Robert Griesemer [Thu, 8 Mar 2012 05:28:50 +0000 (21:28 -0800)]
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

13 years agodoc: link to go1 and go1compat from docs index
Andrew Gerrand [Thu, 8 Mar 2012 05:10:55 +0000 (16:10 +1100)]
doc: link to go1 and go1compat from docs index

Fixes #3239.

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

13 years agodoc: add go command notes to the Go 1 doc
Andrew Gerrand [Thu, 8 Mar 2012 05:09:49 +0000 (16:09 +1100)]
doc: add go command notes to the Go 1 doc

Fixes #2912.

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

13 years agocmd/gc: implement len(array) / cap(array) rule
Russ Cox [Thu, 8 Mar 2012 03:43:28 +0000 (22:43 -0500)]
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

13 years agocmd/cgo: silence const warnings
Russ Cox [Thu, 8 Mar 2012 03:40:32 +0000 (22:40 -0500)]
cmd/cgo: silence const warnings

Fixes #3152.

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

13 years agodoc: pngcrush and remove old, unused images
Andrew Gerrand [Thu, 8 Mar 2012 03:18:28 +0000 (14:18 +1100)]
doc: pngcrush and remove old, unused images

R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/5758047

13 years agodoc: fix freebsd build
Shenghou Ma [Thu, 8 Mar 2012 03:04:49 +0000 (12:04 +0900)]
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

13 years agocmd/gc: delete old map delete in walk
Russ Cox [Thu, 8 Mar 2012 03:03:35 +0000 (22:03 -0500)]
cmd/gc: delete old map delete in walk

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

13 years agogo/build, cmd/go: add support for .syso files
Russ Cox [Thu, 8 Mar 2012 03:03:18 +0000 (22:03 -0500)]
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

13 years agodoc: link to sub-repositories from reference page
Andrew Gerrand [Thu, 8 Mar 2012 02:36:38 +0000 (13:36 +1100)]
doc: link to sub-repositories from reference page

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

13 years agoio: minor change in io.WriteAt docs.
Francisco Souza [Thu, 8 Mar 2012 01:49:13 +0000 (12:49 +1100)]
io: minor change in io.WriteAt docs.

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

13 years agogo/scanner: better panic diagnostic
Robert Griesemer [Thu, 8 Mar 2012 00:57:26 +0000 (16:57 -0800)]
go/scanner: better panic diagnostic

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

13 years agowindows: make background of gopher icon transparent
Volker Dobler [Thu, 8 Mar 2012 00:31:46 +0000 (18:31 -0600)]
windows: make background of gopher icon transparent

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

13 years agodoc/go1.tmpl: small change left behind from abf39116ffac
Alex Brainman [Wed, 7 Mar 2012 23:01:15 +0000 (10:01 +1100)]
doc/go1.tmpl: small change left behind from abf39116ffac

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

13 years agopath/filepath: retrieve real file name in windows EvalSymlinks
Alex Brainman [Wed, 7 Mar 2012 23:00:25 +0000 (10:00 +1100)]
path/filepath: retrieve real file name in windows EvalSymlinks

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

13 years agobuild: re-enable some broken tests in run.bash
Shenghou Ma [Wed, 7 Mar 2012 22:23:56 +0000 (06:23 +0800)]
build: re-enable some broken tests in run.bash
        Updates #2982.

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

13 years agocmd/go: support -compiler for go list, fix isStale for gccgo.
Rémy Oudompheng [Wed, 7 Mar 2012 22:15:55 +0000 (23:15 +0100)]
cmd/go: support -compiler for go list, fix isStale for gccgo.

Fixes #3228.

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

13 years agoencoding/gob: fix memory corruption
Dmitriy Vyukov [Wed, 7 Mar 2012 21:53:08 +0000 (08:53 +1100)]
encoding/gob: fix memory corruption
Fixes #3175.

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

13 years agoruntime: fix freebsd crash
Russ Cox [Wed, 7 Mar 2012 20:30:54 +0000 (15:30 -0500)]
runtime: fix freebsd crash

FreeBSD, alone among our supported operating systems,
required that usleep not be interrupted.  Don't require that.

Fixes #3217.

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

13 years agogo/parser: better error synchronization
Robert Griesemer [Wed, 7 Mar 2012 20:24:20 +0000 (12:24 -0800)]
go/parser: better error synchronization

gofmt reports now a single, accurate error for
the test case of issue 3106.

Also: Added test harness for general error
checking and two test cases for now.

Fixes #3106.

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

13 years agodoc/go_mem: init-created goroutine behavior changes for Go 1
Shenghou Ma [Wed, 7 Mar 2012 19:56:31 +0000 (03:56 +0800)]
doc/go_mem: init-created goroutine behavior changes for Go 1
        They can start execution even before all init functions end.

R=rsc, r, adg
CC=golang-dev
https://golang.org/cl/5732061

13 years agonet, net/rpc, reflect, time: document concurrency guarantees
Russ Cox [Wed, 7 Mar 2012 19:55:09 +0000 (14:55 -0500)]
net, net/rpc, reflect, time: document concurrency guarantees

Fixes #1599.

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

13 years agotesting: do not print 'no tests' when there are examples
Russ Cox [Wed, 7 Mar 2012 19:54:31 +0000 (14:54 -0500)]
testing: do not print 'no tests' when there are examples

I am not sure why RunTests and RunExamples are
exported, but I assume that because they are we
should not change the signature, so I added an
unexported global shared by Main and RunTests.

Fixes #3237.

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

13 years agoruntime: try extending arena size in 32-bit allocator.
Rémy Oudompheng [Wed, 7 Mar 2012 19:21:45 +0000 (14:21 -0500)]
runtime: try extending arena size in 32-bit allocator.

If it didn't reach the limit, we can try extending the arena
before resorting to random memory mappings and praying for the
kernel to be kind.

Fixes #3173.

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

13 years agotest: enable method expression tests in ddd.go
Ian Lance Taylor [Wed, 7 Mar 2012 19:17:26 +0000 (11:17 -0800)]
test: enable method expression tests in ddd.go

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

13 years agotest: fix testlib to not pass an empty argument to 6g
Ian Lance Taylor [Wed, 7 Mar 2012 19:16:58 +0000 (11:16 -0800)]
test: fix testlib to not pass an empty argument to 6g

This change is necessary to make the run shell script work
again, but it is not sufficient as bug424.go's execution line
does not name the package that it imports.

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

13 years agodoc: give up on OS X Leopard
Russ Cox [Wed, 7 Mar 2012 18:57:57 +0000 (13:57 -0500)]
doc: give up on OS X Leopard

Fixes #3206.

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

13 years agoio: more docs on WriterAt
Brad Fitzpatrick [Wed, 7 Mar 2012 18:54:04 +0000 (10:54 -0800)]
io: more docs on WriterAt

Updates #1599

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

13 years agodeps: allow crypto/x509 to use syscall
Mikkel Krautz [Wed, 7 Mar 2012 18:51:05 +0000 (13:51 -0500)]
deps: allow crypto/x509 to use syscall

Allows the Windows part of CL 5700087 to land.

I had build tested CL 5753060 (which allows
crypto/x509 to use cgo and io/ioutil), and
didn't spot any errors on Windows.

Turns out I was wrong.

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

13 years agogo/parser: better error sync. if commas are missing
Robert Griesemer [Wed, 7 Mar 2012 18:19:32 +0000 (10:19 -0800)]
go/parser: better error sync. if commas are missing

This time for sure.
Runs all tests.

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

13 years agogodoc: update documentation
Robert Griesemer [Wed, 7 Mar 2012 18:19:16 +0000 (10:19 -0800)]
godoc: update documentation

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

13 years agocrypto/x509: new home for root fetchers; build chains using Windows API
Mikkel Krautz [Wed, 7 Mar 2012 18:12:35 +0000 (13:12 -0500)]
crypto/x509: new home for root fetchers; build chains using Windows API

This moves the various CA root fetchers from crypto/tls into crypto/x509.

The move was brought about by issue 2997. Windows doesn't ship with all
its root certificates, but will instead download them as-needed when using
CryptoAPI for certificate verification.

This CL changes crypto/x509 to verify a certificate using the system root
CAs when VerifyOptions.RootCAs == nil. On Windows, this verification is
now implemented using Windows's CryptoAPI. All other root fetchers are
unchanged, and still use Go's own verification code.

The CL also fixes the hostname matching logic in crypto/tls/tls.go, in
order to be able to test whether hostname mismatches are honored by the
Windows verification code.

The move to crypto/x509 also allows other packages to use the OS-provided
root certificates, instead of hiding them inside the crypto/tls package.

Fixes #2997.

R=agl, golang-dev, alex.brainman, rsc, mikkel
CC=golang-dev
https://golang.org/cl/5700087

13 years agocmd/go: fix go test -compiler
Russ Cox [Wed, 7 Mar 2012 17:09:43 +0000 (12:09 -0500)]
cmd/go: fix go test -compiler

The compiler must be changed with the Set method
so that the buildToolchain gets updated too.

Fixes #3231.

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

13 years agonet: delete usableLocalPort from test
Russ Cox [Wed, 7 Mar 2012 17:06:22 +0000 (12:06 -0500)]
net: delete usableLocalPort from test

The old way to find a port was to listen :0 and then
look at what port it picked, close the listener, and then
immediately try to listen on that port.

On some Windows 7 machines that sequence fails at
the second listen, because the first one is still lingering
in the TCP/IP stack somewhere.  (Ironically, most of these
are used in tests of a "second listen", which in this case
ends up being the third listen.)

Instead of this race, just return the listener from the
function, replacing usableLocalPort+Listen with
usableListenPort.

Fixes #3219.

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

13 years agodoc: update effective_go.tmpl
Russ Cox [Wed, 7 Mar 2012 16:57:54 +0000 (11:57 -0500)]
doc: update effective_go.tmpl

Forgot this half in https://golang.org/cl/5764044

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

13 years agoruntime/pprof: disable test on Leopard 64-bit
Russ Cox [Wed, 7 Mar 2012 16:44:54 +0000 (11:44 -0500)]
runtime/pprof: disable test on Leopard 64-bit

Fixes #3234.

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