]> Cypherpunks repositories - gostls13.git/log
gostls13.git
14 years agoos, syscall: refactor Unix directory parsing
Russ Cox [Wed, 6 Apr 2011 19:44:40 +0000 (15:44 -0400)]
os, syscall: refactor Unix directory parsing

Moved the details of how to read a directory
and how to parse the results behind the new
syscall functions ReadDirent and ParseDirent.

Now os needs just one copy of Readdirnames
for the three Unix variants, and it no longer
imports "unsafe".

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

14 years agoexec: add a little package commentary explaining its
Rob Pike [Wed, 6 Apr 2011 19:37:17 +0000 (12:37 -0700)]
exec: add a little package commentary explaining its
relationship to os.Process.

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4384041

14 years agofix build (sorry)
Russ Cox [Wed, 6 Apr 2011 19:13:18 +0000 (15:13 -0400)]
fix build (sorry)

TBR=r
CC=golang-dev
https://golang.org/cl/4378042

14 years agosrc/pkg/Makefile: trim per-directory make output except on failure
Russ Cox [Wed, 6 Apr 2011 19:06:28 +0000 (15:06 -0400)]
src/pkg/Makefile: trim per-directory make output except on failure

Not committed to this but it sure makes
the output easier to skim.  With this CL:

$ make
install runtime
install sync/atomic
install sync
install unicode
install utf16
install syscall
install os
...
install ../cmd/govet
install ../cmd/goyacc
install ../cmd/hgpatch
$ make test
test archive/tar
test archive/zip
test asn1
test big
test bufio
...
test path
test path/filepath
TEST FAIL reflect
gotest
rm -f _test/reflect.a
6g -o _gotest_.6 deepequal.go type.go value.go
rm -f _test/reflect.a
gopack grc _test/reflect.a _gotest_.6
all_test.go:210: invalid type assertion: reflect.NewValue(tt.i).(*StructValue) (non-interface type reflect.Value on left)
all_test.go:217: cannot type switch on non-interface value v (type reflect.Value)
all_test.go:218: undefined: IntValue
all_test.go:221: cannot use 132 (type int) as type reflect.Value in function argument
all_test.go:223: cannot use 8 (type int) as type reflect.Value in function argument
all_test.go:225: cannot use 16 (type int) as type reflect.Value in function argument
all_test.go:227: cannot use 32 (type int) as type reflect.Value in function argument
all_test.go:229: cannot use 64 (type int) as type reflect.Value in function argument
all_test.go:231: undefined: UintValue
all_test.go:234: cannot use 132 (type int) as type reflect.Value in function argument
all_test.go:234: too many errors
gotest: "/Users/rsc/g/go/bin/6g -I _test -o _xtest_.6 all_test.go tostring_test.go" failed: exit status 1
make[1]: *** [test] Error 2
make: *** [reflect.test] Error 1

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

14 years agolog: generalize getting and setting flags and prefix.
Rob Pike [Wed, 6 Apr 2011 18:48:03 +0000 (11:48 -0700)]
log: generalize getting and setting flags and prefix.
- used to be only for standard log, not for user-built.
- there were no getters.
Also rearrange the code a little so we can avoid allocating
a buffer on every call.  Logging is expensive but we should
avoid unnecessary cost.

This should have no effect on existing code.

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

14 years agocrypto/rsa: add 3-prime support.
Adam Langley [Wed, 6 Apr 2011 18:11:56 +0000 (14:11 -0400)]
crypto/rsa: add 3-prime support.

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4365041

14 years agocrypto/rsa: flip the CRT code over so that it matches PKCS#1
Adam Langley [Wed, 6 Apr 2011 14:22:04 +0000 (10:22 -0400)]
crypto/rsa: flip the CRT code over so that it matches PKCS#1

The CRT is symmetrical in the case of two variables and I picked a
different form from PKCS#1.

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4381041

14 years agopkg/path: enable tests on Windows
Alex Brainman [Wed, 6 Apr 2011 06:45:20 +0000 (16:45 +1000)]
pkg/path: enable tests on Windows

Fixes #1107.

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

14 years agohttp: allow override of Content-Type for ServeFile
Andrew Gerrand [Wed, 6 Apr 2011 04:52:42 +0000 (14:52 +1000)]
http: allow override of Content-Type for ServeFile

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

14 years agocrypto/rsa: add support for precomputing CRT values.
Adam Langley [Tue, 5 Apr 2011 22:07:01 +0000 (18:07 -0400)]
crypto/rsa: add support for precomputing CRT values.

This speeds up private key operations by 3.5x (for a 2048-bit
modulus).

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

14 years agocrypto/ecdsa, crypto/rsa: use io.ReadFull to read from random source.
Dmitry Chestnykh [Tue, 5 Apr 2011 21:11:31 +0000 (17:11 -0400)]
crypto/ecdsa, crypto/rsa: use io.ReadFull to read from random source.

R=golang-dev, agl1
CC=golang-dev
https://golang.org/cl/4316057

14 years agoA+C: Dmitry Chestnykh (individual CLA)
Russ Cox [Tue, 5 Apr 2011 21:07:56 +0000 (17:07 -0400)]
A+C: Dmitry Chestnykh (individual CLA)

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

14 years agogotest: fix windows build.
Rob Pike [Tue, 5 Apr 2011 20:51:49 +0000 (13:51 -0700)]
gotest: fix windows build.

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

14 years agoroadmap: add sections on tools, packages.
Rob Pike [Tue, 5 Apr 2011 20:25:58 +0000 (13:25 -0700)]
roadmap: add sections on tools, packages.

R=golang-dev, rsc1, r2, bradfitzgo, gri
CC=golang-dev
https://golang.org/cl/4344068

14 years agogotest: fix a bug in error handling.
Rob Pike [Tue, 5 Apr 2011 19:51:10 +0000 (12:51 -0700)]
gotest: fix a bug in error handling.
If the command couldn't be found, argv[0] would be wiped.
Also, fix a print statement not to refer to make - it was a vestige of a prior form.

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

14 years agocrypto/des: cleanups
Adam Langley [Tue, 5 Apr 2011 19:40:48 +0000 (15:40 -0400)]
crypto/des: cleanups

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

14 years agocrypto/block: remove deprecated package.
Adam Langley [Tue, 5 Apr 2011 19:23:40 +0000 (15:23 -0400)]
crypto/block: remove deprecated package.

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

14 years agogotest: fixes for [^.]_test file pattern
Peter Mundy [Tue, 5 Apr 2011 18:49:44 +0000 (11:49 -0700)]
gotest: fixes for [^.]_test file pattern

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

14 years agospec: add parens missing from "protect" example.
Rob Pike [Tue, 5 Apr 2011 18:01:25 +0000 (11:01 -0700)]
spec: add parens missing from "protect" example.
Fixes #1665.

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

14 years agogofix: don't rewrite O_APPEND opens
Russ Cox [Tue, 5 Apr 2011 15:12:02 +0000 (11:12 -0400)]
gofix: don't rewrite O_APPEND opens

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

14 years agocrypto/des: new package providing implementations of DES and TDEA
Yasuhiro Matsumoto [Tue, 5 Apr 2011 14:59:10 +0000 (10:59 -0400)]
crypto/des: new package providing implementations of DES and TDEA
Original code by Chris Lennert <cale...@gmail.com>

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

14 years agoos: fix windows build
Rob Pike [Tue, 5 Apr 2011 06:57:08 +0000 (23:57 -0700)]
os: fix windows build

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

14 years agoos: New Open API.
Rob Pike [Tue, 5 Apr 2011 06:42:14 +0000 (23:42 -0700)]
os: New Open API.
We replace the current Open with:
OpenFile(name, flag, perm) // same as old Open
Open(name) // same as old Open(name, O_RDONLY, 0)
Create(name) // same as old Open(name, O_RDWR|O_TRUNC|O_CREAT, 0666)

This CL includes a gofix module and full code updates: all.bash passes.
(There may be a few comments I missed.)

The interesting packages are:
        gofix
        os
Everything else is automatically generated except for hand tweaks to:
        src/pkg/io/ioutil/ioutil.go
        src/pkg/io/ioutil/tempfile.go
        src/pkg/crypto/tls/generate_cert.go
        src/cmd/goyacc/goyacc.go
        src/cmd/goyacc/units.y

R=golang-dev, bradfitzwork, rsc, r2
CC=golang-dev
https://golang.org/cl/4357052

14 years agotag weekly.2011-04-04
Andrew Gerrand [Tue, 5 Apr 2011 02:56:39 +0000 (12:56 +1000)]
tag weekly.2011-04-04

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

14 years agoweekly.2011-04-04 weekly.2011-04-04
Andrew Gerrand [Tue, 5 Apr 2011 02:55:03 +0000 (12:55 +1000)]
weekly.2011-04-04

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

14 years agohttp: ignore Transfer-Encoding on HEAD responses
Brad Fitzpatrick [Tue, 5 Apr 2011 02:43:36 +0000 (19:43 -0700)]
http: ignore Transfer-Encoding on HEAD responses

Amazon S3 sends Transfer-Encoding "chunked"
on its 404 responses to HEAD requests for
missing objects.

We weren't ignoring the Transfer-Encoding
and were thus interpretting the subsequent
response headers as a chunk header from the
previous responses body (but a HEAD response
can't have a body)

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

14 years agohttp: fix Transport connection re-use race
Brad Fitzpatrick [Tue, 5 Apr 2011 02:22:47 +0000 (19:22 -0700)]
http: fix Transport connection re-use race

A connection shouldn't be made available
for re-use until its body has been consumed.

(except in the case of pipelining, which isn't
implemented yet)

This CL fixes some issues seen with heavy load
against Amazon S3.

Subtle implementation detail: to prevent a race
with the client requesting a new connection
before previous one is returned, we actually
have to call putIdleConnection _before_ we
return from the final Read/Close call on the
http.Response.Body.

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

14 years agonet: fix typo
Mikio Hara [Tue, 5 Apr 2011 01:35:16 +0000 (11:35 +1000)]
net: fix typo

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

14 years agofilepath: new Abs function
Gustavo Niemeyer [Tue, 5 Apr 2011 01:29:24 +0000 (18:29 -0700)]
filepath: new Abs function

R=golang-dev, rsc1, peterGo, bsiegert, r, mattn
CC=golang-dev
https://golang.org/cl/4271057

14 years agohttp: fix hanging bug with HEAD responses
Brad Fitzpatrick [Mon, 4 Apr 2011 23:58:11 +0000 (16:58 -0700)]
http: fix hanging bug with HEAD responses

The transport readLoop was waiting forever for the client to
read the non-existent body before proceeding to read the next
request.

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

14 years agoos: add Seek whence constants
Brad Fitzpatrick [Mon, 4 Apr 2011 20:53:52 +0000 (13:53 -0700)]
os: add Seek whence constants

R=r, r2, rsc1, rsc, jacek.masiulaniec
CC=golang-dev
https://golang.org/cl/4344062

14 years agogotest: fix build
Russ Cox [Mon, 4 Apr 2011 20:35:40 +0000 (16:35 -0400)]
gotest: fix build

TBR=r
CC=golang-dev
https://golang.org/cl/4351047

14 years agopath/filepath.Glob: add an error return.
Rob Pike [Mon, 4 Apr 2011 20:09:34 +0000 (13:09 -0700)]
path/filepath.Glob: add an error return.
The error will only occur for invalid patterns, but without this
error path there is no way to know that Glob has failed due to
an invalid pattern.

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

14 years agobufio: Write and WriteString cleanup
Evan Shaw [Mon, 4 Apr 2011 19:57:10 +0000 (15:57 -0400)]
bufio: Write and WriteString cleanup

Write never writes less than the buffer size and WriteString takes advantage
of the copy built-in to improve write efficiency.

R=rsc, ality, rog
CC=golang-dev
https://golang.org/cl/4344060

14 years agohttp: use upper case hex in URL escaping
Matt Jones [Mon, 4 Apr 2011 19:49:49 +0000 (15:49 -0400)]
http: use upper case hex in URL escaping

According to RFC 3986: "For consistency, URI producers
and normalizers should use uppercase hexadecimal digits
for all percent-encodings."  Using lower case characters
makes it incompatible with Google APIs when signing OAuth requests.

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

14 years agoCONTRIBUTORS: add Matt Jones (Google CLA)
Russ Cox [Mon, 4 Apr 2011 19:48:43 +0000 (15:48 -0400)]
CONTRIBUTORS: add Matt Jones (Google CLA)

R=golang-dev, r2
CC=golang-dev, mrjones
https://golang.org/cl/4348048

14 years agocodereview: only retry on HTTP 500 error
Russ Cox [Mon, 4 Apr 2011 19:47:32 +0000 (15:47 -0400)]
codereview: only retry on HTTP 500 error

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

14 years agoos: Fix MkdirAll("/thisdoesnotexist").
Albert Strasheim [Mon, 4 Apr 2011 19:45:03 +0000 (15:45 -0400)]
os: Fix MkdirAll("/thisdoesnotexist").

Fixes #1637.

R=rsc, rh, msolo
CC=golang-dev
https://golang.org/cl/4317049

14 years agosyscall: add BPF support for freebsd/386, freebsd/amd64
Mikio Hara [Mon, 4 Apr 2011 19:40:40 +0000 (15:40 -0400)]
syscall: add BPF support for freebsd/386, freebsd/amd64

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

14 years agohttptest: add NewTLSServer
Brad Fitzpatrick [Mon, 4 Apr 2011 15:32:59 +0000 (08:32 -0700)]
httptest: add NewTLSServer

Enables the use of https servers in tests.

R=agl, rsc, agl1
CC=golang-dev
https://golang.org/cl/4284063

14 years agohttp: make triv.go example compile again
Brad Fitzpatrick [Mon, 4 Apr 2011 15:10:26 +0000 (08:10 -0700)]
http: make triv.go example compile again

Ideally we'd compile all example files during
the build, though.

Fixes #1660

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

14 years agoversion.bash: strip changeset hash from 'hg tags' output
Andrew Gerrand [Mon, 4 Apr 2011 00:06:09 +0000 (10:06 +1000)]
version.bash: strip changeset hash from 'hg tags' output

Fixes #1651.

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

14 years agopath/filepath: add support for plan9
Andrey Mirtchovski [Sun, 3 Apr 2011 16:11:41 +0000 (09:11 -0700)]
path/filepath: add support for plan9

R=paulzhol, ality, r, fhs
CC=golang-dev
https://golang.org/cl/4316054

14 years agoos: add a few missing plan9 errors
Andrey Mirtchovski [Sun, 3 Apr 2011 15:52:43 +0000 (08:52 -0700)]
os: add a few missing plan9 errors

these were needed by packages in crypto/ and by io/ioutil

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

14 years agoMake.pkg: increase test timeout to 120 seconds.
Ian Lance Taylor [Sun, 3 Apr 2011 05:23:34 +0000 (22:23 -0700)]
Make.pkg: increase test timeout to 120 seconds.

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

14 years agoos: Plan 9 support.
Yuval Pavel Zholkover [Sat, 2 Apr 2011 21:28:58 +0000 (14:28 -0700)]
os: Plan 9 support.

R=rsc, ality, r, r2
CC=golang-dev
https://golang.org/cl/4149046

14 years agoR=rsc, brainman, ality, r2, r
Yuval Pavel Zholkover [Sat, 2 Apr 2011 21:24:03 +0000 (14:24 -0700)]
R=rsc, brainman, ality, r2, r
CC=golang-dev
https://golang.org/cl/3816043

14 years agogo/parser: package name must not be the blank identifier
Robert Griesemer [Sat, 2 Apr 2011 03:51:55 +0000 (20:51 -0700)]
go/parser: package name must not be the blank identifier

R=r, r2, rsc1
CC=golang-dev
https://golang.org/cl/4343045

14 years agosyscall: make Rawsyscall6 pass 6th arg on linux/386
Evan Shaw [Sat, 2 Apr 2011 02:26:57 +0000 (22:26 -0400)]
syscall: make Rawsyscall6 pass 6th arg on linux/386

Forgot this one in the previous CL

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

14 years agogc: avoid saying same error 3 times
Russ Cox [Sat, 2 Apr 2011 00:52:38 +0000 (20:52 -0400)]
gc: avoid saying same error 3 times

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

14 years agosyscall: make Syscall6 pass 6th arg on linux/386
Evan Shaw [Sat, 2 Apr 2011 00:46:01 +0000 (20:46 -0400)]
syscall: make Syscall6 pass 6th arg on linux/386

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

14 years agopath/filepath.Glob: don't drop known matches on error.
Rob Pike [Fri, 1 Apr 2011 16:58:05 +0000 (09:58 -0700)]
path/filepath.Glob: don't drop known matches on error.
Fixes #1610.

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

14 years agomisc/notepadplus: add syntax and completion support for notepad++
Anthony Starks [Fri, 1 Apr 2011 03:44:57 +0000 (14:44 +1100)]
misc/notepadplus: add syntax and completion support for notepad++

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

14 years agogotest: another attempt to make it run on Windows
Alex Brainman [Fri, 1 Apr 2011 02:38:33 +0000 (13:38 +1100)]
gotest: another attempt to make it run on Windows

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4347041

14 years agogotest: execute gomake properly on Windows
Alex Brainman [Thu, 31 Mar 2011 23:10:15 +0000 (10:10 +1100)]
gotest: execute gomake properly on Windows

R=peterGo, rsc, Joe Poirier
CC=golang-dev
https://golang.org/cl/4280087

14 years agotesting: add -test.timeout option.
Ian Lance Taylor [Thu, 31 Mar 2011 22:27:51 +0000 (15:27 -0700)]
testing: add -test.timeout option.

Since Go code can deadlock, this lets a testsuite driver set a
time limit for the test to run.  This is simple but imperfect,
in that it only catches deadlocks in Go code, not in the
runtime scheduler.

R=r, rsc, iant2
CC=golang-dev
https://golang.org/cl/4326048

14 years agofmt: implement precs for %q.
Rob Pike [Thu, 31 Mar 2011 21:56:01 +0000 (14:56 -0700)]
fmt: implement precs for %q.
Also fix a bug: precision was in terms of bytes; should be runes.
Fixes #1652.

R=rsc, bradfitzgo, r2, bradfitzwork
CC=golang-dev
https://golang.org/cl/4280086

14 years agoroadmap: remove description of implementation of garbage collector.
Rob Pike [Thu, 31 Mar 2011 20:13:04 +0000 (13:13 -0700)]
roadmap: remove description of implementation of garbage collector.
It was speculation.
Also replace one silly word with an English replacement.

R=golang-dev, bradfitzgo
CC=golang-dev
https://golang.org/cl/4339041

14 years agohttp: add Transport.MaxIdleConnsPerHost
Brad Fitzpatrick [Thu, 31 Mar 2011 19:58:50 +0000 (12:58 -0700)]
http: add Transport.MaxIdleConnsPerHost

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

14 years agonet, syscall: fix windows build
Alexey Borzenkov [Thu, 31 Mar 2011 04:16:18 +0000 (15:16 +1100)]
net, syscall: fix windows build

Fix resolv_windows.go to support recent DNS-lookup changes

R=brainman, rsc1, rsc
CC=golang-dev
https://golang.org/cl/4300045

14 years agogotest: another try at flags.
Rob Pike [Thu, 31 Mar 2011 04:14:49 +0000 (21:14 -0700)]
gotest: another try at flags.
doc.go contains the details. The short story:
- command line is passed to the binary
- a new flag, -file, is needed to name files
- known flags have the "test." prefix added for convenience.
- gotest-specific flags are trimmed from the command line.

The effect should be that most existing uses are unaffected,
the ability to name files is still present, and it's nicer to use.
The downside is a lot more code in gotest.

Also allow a test to be called just Test.

R=rsc, niemeyer, rog, r2
CC=golang-dev
https://golang.org/cl/4307049

14 years agogopack: comment out debugging print
Russ Cox [Thu, 31 Mar 2011 02:41:32 +0000 (22:41 -0400)]
gopack: comment out debugging print

TBR=r
CC=golang-dev
https://golang.org/cl/4333048

14 years agogopack: add P flag to remove prefix from filename information
Russ Cox [Thu, 31 Mar 2011 02:19:02 +0000 (22:19 -0400)]
gopack: add P flag to remove prefix from filename information

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

14 years agofmt: remove uintptrGetter type checks
Russ Cox [Thu, 31 Mar 2011 02:12:30 +0000 (22:12 -0400)]
fmt: remove uintptrGetter type checks

This will make the fmt code easier to gofix
when the new reflect interface is ready.

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

14 years agogotype: support for more tests, added one new test
Robert Griesemer [Wed, 30 Mar 2011 22:27:23 +0000 (15:27 -0700)]
gotype: support for more tests, added one new test

also: minor fix to parser

Note: gotest won't run the gotype test yet until
it permits TestXXX functions where XXX is empty.

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

14 years agoscanner: treat line comments like in Go
Robert Griesemer [Wed, 30 Mar 2011 22:26:53 +0000 (15:26 -0700)]
scanner: treat line comments like in Go

- don't consume '\n' as part of line comment
(otherwise grammars where '\n' are tokens won't
see them after a line comment)

- permit line comments to end in EOF

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

14 years agotest: don't require specific GOARCH values.
Ian Lance Taylor [Wed, 30 Mar 2011 21:24:32 +0000 (14:24 -0700)]
test: don't require specific GOARCH values.

This lets the test work for gccgo on other architectures.

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

14 years agogotest: exclude . files when parsing directories (per r's suggestion)
Robert Griesemer [Wed, 30 Mar 2011 16:46:11 +0000 (09:46 -0700)]
gotest: exclude . files when parsing directories (per r's suggestion)

R=r, rsc1, iant2
CC=golang-dev
https://golang.org/cl/4329044

14 years agogo/parser: fix scoping for local type declarations
Roger Peppe [Wed, 30 Mar 2011 16:45:51 +0000 (09:45 -0700)]
go/parser: fix scoping for local type declarations

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

14 years agogodoc: remove errant space in HTML tag
Andrew Gerrand [Wed, 30 Mar 2011 05:41:41 +0000 (16:41 +1100)]
godoc: remove errant space in HTML tag

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

14 years agogo/printer/gofmt: remove special case for multi-line raw strings
Robert Griesemer [Wed, 30 Mar 2011 01:30:59 +0000 (18:30 -0700)]
go/printer/gofmt: remove special case for multi-line raw strings

As a special case, multi-line raw strings (i.e., strings in `` quotes)
were not indented if they were the only token on a line. This heuristic
was meant to improve formatting for multi-line raw strings where sub-
sequent lines are not indented at the level of the surrounding code.
Multiple people have complained about this. Removing the heuristic
again because it makes the formatting more regular, easier to under-
stand, and simplifies the implementation.

- manual changes to ebnf/ebnf_test.go for readability
- gofmt -w src misc

Fixes #1643.

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

14 years agotime: make TestAfterQueuing retry 3 times before declaring failure.
Andrew Gerrand [Wed, 30 Mar 2011 00:40:00 +0000 (11:40 +1100)]
time: make TestAfterQueuing retry 3 times before declaring failure.

I'm in two minds as to whether this should be a function of gotest.
Tests that can flake out like this should be rare enough that we
needn't add more mechanism.

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

14 years agotest: add test for interfaces with unexported methods.
Ian Lance Taylor [Tue, 29 Mar 2011 22:04:19 +0000 (15:04 -0700)]
test: add test for interfaces with unexported methods.

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

14 years agotest: adjust bug324 to expect run-time failure, not compile-time.
Ian Lance Taylor [Tue, 29 Mar 2011 22:03:09 +0000 (15:03 -0700)]
test: adjust bug324 to expect run-time failure, not compile-time.

Failing at compile time requires that for each conversion
between two interface types the compiler compare the sets of
unexported methods to see if they come from different
packages.  Since this test will fail approximately never on
real code, and since it can't catch all cases of the problem,
I don't think it's worth testing in the compiler.  This CL
changes this test to look for a run-time panic rather than a
compile-time error.

R=gri, rsc1, iant2, rsc
CC=golang-dev
https://golang.org/cl/4332041

14 years agocrypto/tls: extend NPN support to the client.
Adam Langley [Tue, 29 Mar 2011 21:53:09 +0000 (17:53 -0400)]
crypto/tls: extend NPN support to the client.

R=bradfitzgo, rsc1, bradfitzwork
CC=golang-dev
https://golang.org/cl/4277085

14 years agoprints: fix a couple of formatting errors caught by govet
Rob Pike [Tue, 29 Mar 2011 21:03:08 +0000 (14:03 -0700)]
prints: fix a couple of formatting errors caught by govet

R=rsc, agl, agl1
CC=golang-dev
https://golang.org/cl/4337041

14 years agogotest: replace the shell script with the compiled program written in go.
Rob Pike [Tue, 29 Mar 2011 20:29:20 +0000 (13:29 -0700)]
gotest: replace the shell script with the compiled program written in go.
Update the make sequence: gotest must now be installed after the packages.

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

14 years agogovet: fix bug introduced at 4313054
Rob Pike [Tue, 29 Mar 2011 20:18:52 +0000 (13:18 -0700)]
govet: fix bug introduced at 4313054

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

14 years agogotry: move into its own directory, separate from gotest.
Rob Pike [Tue, 29 Mar 2011 20:00:24 +0000 (13:00 -0700)]
gotry: move into its own directory, separate from gotest.

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

14 years agongotest: correctly handle packages with tests outside the package.
Rob Pike [Tue, 29 Mar 2011 19:50:41 +0000 (12:50 -0700)]
ngotest: correctly handle packages with tests outside the package.

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

14 years agocrypto/cipher: bad CTR IV length now triggers panic
Adam Langley [Tue, 29 Mar 2011 19:47:35 +0000 (15:47 -0400)]
crypto/cipher: bad CTR IV length now triggers panic

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

14 years agosyscall: StartProcess Chroot and Credential.
Albert Strasheim [Tue, 29 Mar 2011 18:29:22 +0000 (14:29 -0400)]
syscall: StartProcess Chroot and Credential.

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

14 years agonet: move bind back to sock.go
Alexey Borzenkov [Tue, 29 Mar 2011 18:23:42 +0000 (14:23 -0400)]
net: move bind back to sock.go

It was left in netFD.connect() by an oversight (as the name
implies, bind has no business being in connect). As a result
of this change and by only calling netFD.connect() when ra
isn't nil it becomes simpler with less code duplication.

Additionally, if netFD.connect() fails, set sysfd to -1 to
avoid finalizers (e.g. on windows) calling shutdown on a
closed and possibly reopened socket that just happened to
share the same descriptor.

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

14 years agoos: fix FileInfo.Name returned by Stat
David Forsythe [Tue, 29 Mar 2011 18:23:36 +0000 (14:23 -0400)]
os: fix FileInfo.Name returned by Stat

Fixes #1645.

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

14 years agoA+C: David Forsythe (individual CLA)
Russ Cox [Tue, 29 Mar 2011 18:18:45 +0000 (14:18 -0400)]
A+C: David Forsythe (individual CLA)

R=golang-dev, r2
CC=golang-dev
https://golang.org/cl/4333041

14 years agodebug/gosym: remove need for gotest to run preparatory commands.
Rob Pike [Tue, 29 Mar 2011 17:41:23 +0000 (10:41 -0700)]
debug/gosym: remove need for gotest to run preparatory commands.
Put them into the Makefile instead. One dependency mechanism is enough.

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

14 years agongotest: a new gotest command, written in Go.
Rob Pike [Tue, 29 Mar 2011 17:11:33 +0000 (10:11 -0700)]
ngotest: a new gotest command, written in Go.
It runs all tests correctly and saves significant time by avoiding the shell script.
However, this is just the code for the command, for review.
A separate CL will move this into the real gotest, which will take some dancing.

R=rsc, peterGo, bsiegert, albert.strasheim, rog, niemeyer, r2
CC=golang-dev
https://golang.org/cl/4281073

14 years agoCL 4291070: incorporating rsc's feedback
Robert Griesemer [Tue, 29 Mar 2011 16:08:23 +0000 (09:08 -0700)]
CL 4291070: incorporating rsc's feedback

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

14 years agocrypto/x509: Parse Extended Key Usage extension
Mikkel Krautz [Tue, 29 Mar 2011 14:35:34 +0000 (10:35 -0400)]
crypto/x509: Parse Extended Key Usage extension

This changeset makes it possible for crypto/x509 to parse
certificates that include the 'Extended Key Usage' extension
with the critical bit set.

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

14 years agoasn1: extensions needed for parsing Kerberos
Adam Langley [Tue, 29 Mar 2011 14:33:47 +0000 (10:33 -0400)]
asn1: extensions needed for parsing Kerberos

* Adds support for GENERAL STRING
* Adds support for APPLICATION tagged values.
* Add UnmarshalWithParams to set parameters for the top-level
  structure

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

14 years agotest: adjust bugs/bug322 to match current spec.
Ian Lance Taylor [Tue, 29 Mar 2011 13:49:21 +0000 (06:49 -0700)]
test: adjust bugs/bug322 to match current spec.

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

14 years agotest: avoid undefined error in syntax/if.go.
Ian Lance Taylor [Tue, 29 Mar 2011 13:48:20 +0000 (06:48 -0700)]
test: avoid undefined error in syntax/if.go.

Without this the gccgo version of errchk reports an unmatched
error.

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4327041

14 years agotest: match gccgo error messages for syntax/chan.go.
Ian Lance Taylor [Tue, 29 Mar 2011 13:47:39 +0000 (06:47 -0700)]
test: match gccgo error messages for syntax/chan.go.

chan.go:11:1: error: unexpected ‘}’ in channel type
chan.go:13:16: error: unexpected ‘)’ in channel type
chan.go:16:16: error: unexpected comma in channel type

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4313055

14 years agobytes, strings: simplify Join
Evan Shaw [Tue, 29 Mar 2011 05:27:38 +0000 (01:27 -0400)]
bytes, strings: simplify Join

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

14 years agokate: reorganize, remove closed()
Evan Shaw [Tue, 29 Mar 2011 05:12:39 +0000 (01:12 -0400)]
kate: reorganize, remove closed()

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

14 years agonet: implement non-blocking connect
Alexey Borzenkov [Tue, 29 Mar 2011 03:40:01 +0000 (23:40 -0400)]
net: implement non-blocking connect

Refactored bind/connect from sock.go into netFD.connect(), as
a consequence newFD() doesn't accept laddr/raddr anymore, and
expects an (optional) call to netFD.connect() followed by a
call to netFD.setAddr().
Windows code is updated, but still uses blocking connect,
since otherwise it needs support for ConnectEx syscall.

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

14 years agofix build
Russ Cox [Tue, 29 Mar 2011 03:39:39 +0000 (23:39 -0400)]
fix build

TBR=adg
CC=golang-dev
https://golang.org/cl/4322041

14 years agogofix: netdial
Russ Cox [Tue, 29 Mar 2011 03:29:00 +0000 (23:29 -0400)]
gofix: netdial

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

14 years agoupdate tree for package net changes
Russ Cox [Tue, 29 Mar 2011 03:28:53 +0000 (23:28 -0400)]
update tree for package net changes

Converted with gofix.

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

14 years agonet: drop laddr from Dial, cname from LookupHost; new functions
Russ Cox [Tue, 29 Mar 2011 03:28:42 +0000 (23:28 -0400)]
net: drop laddr from Dial, cname from LookupHost; new functions

Drop laddr argument from Dial.

Drop cname return from LookupHost.

Add LookupIP, LookupCNAME, ParseCIDR, IP.Equal.
Export SplitHostPort, JoinHostPort.
Add AAAA (IPv6) support to host lookups.

Preparations for implementing some of the
lookups using cgo.

ParseCIDR and IP.Equal are logically new in this CL
but accidentally snuck into an earlier CL about unused
labels that was in the same client.

In crypto/tls, drop laddr from Dial to match net.

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