1
0
mirror of https://github.com/golang/go synced 2024-10-04 15:21:22 -06:00
Commit Graph

5893 Commits

Author SHA1 Message Date
Russ Cox
877c1892bb gofix: add -diff, various fixes and helpers
* add -diff command line option
  * use scoping information in refersTo, isPkgDot, isPtrPkgDot.
  * add new scoping-based helpers countUses, rewriteUses, assignsTo, isTopName.
  * rename rewrite to walk, add walkBeforeAfter.
  * add toy typechecker, a placeholder for go/types

R=gri
CC=golang-dev
https://golang.org/cl/4285053
2011-04-08 12:27:08 -04:00
Russ Cox
fb175cf77e reflect: new Type and Value definitions
Type is now an interface that implements all the possible type methods.
Instead of a type switch on a reflect.Type t, switch on t.Kind().
If a method is invoked on the wrong kind of type (for example,
calling t.Field(0) when t.Kind() != Struct), the call panics.

There is one method renaming: t.(*ChanType).Dir() is now t.ChanDir().

Value is now a struct value that implements all the possible value methods.
Instead of a type switch on a reflect.Value v, switch on v.Kind().
If a method is invoked on the wrong kind of value (for example,
calling t.Recv() when t.Kind() != Chan), the call panics.

Since Value is now a struct, not an interface, its zero value
cannot be compared to nil.  Instead of v != nil, use v.IsValid().
Instead of other uses of nil as a Value, use Value{}, the zero value.

Many methods have been renamed, most due to signature conflicts:

           OLD                          NEW

    v.(*ArrayValue).Elem             v.Index
    v.(*BoolValue).Get               v.Bool
    v.(*BoolValue).Set               v.SetBool
    v.(*ChanType).Dir                v.ChanDir
    v.(*ChanValue).Get               v.Pointer
    v.(*ComplexValue).Get            v.Complex
    v.(*ComplexValue).Overflow       v.OverflowComplex
    v.(*ComplexValue).Set            v.SetComplex
    v.(*FloatValue).Get              v.Float
    v.(*FloatValue).Overflow         v.OverflowFloat
    v.(*FloatValue).Set              v.SetFloat
    v.(*FuncValue).Get               v.Pointer
    v.(*InterfaceValue).Get          v.InterfaceData
    v.(*IntValue).Get                v.Int
    v.(*IntValue).Overflow           v.OverflowInt
    v.(*IntValue).Set                v.SetInt
    v.(*MapValue).Elem               v.MapIndex
    v.(*MapValue).Get                v.Pointer
    v.(*MapValue).Keys               v.MapKeys
    v.(*MapValue).SetElem            v.SetMapIndex
    v.(*PtrValue).Get                v.Pointer
    v.(*SliceValue).Elem             v.Index
    v.(*SliceValue).Get              v.Pointer
    v.(*StringValue).Get             v.String
    v.(*StringValue).Set             v.SetString
    v.(*UintValue).Get               v.Uint
    v.(*UintValue).Overflow          v.OverflowUint
    v.(*UintValue).Set               v.SetUint
    v.(*UnsafePointerValue).Get      v.Pointer
    v.(*UnsafePointerValue).Set      v.SetPointer

Part of the motivation for this change is to enable a more
efficient implementation of Value, one that does not allocate
memory during most operations.  To reduce the size of the CL,
this CL's implementation is a wrapper around the old API.
Later CLs will make the implementation more efficient without
changing the API.

Other CLs to be submitted at the same time as this one
add support for this change to gofix (4343047) and update
the Go source tree (4353043).

R=gri, iant, niemeyer, r, rog, gustavo, r2
CC=golang-dev
https://golang.org/cl/4281055
2011-04-08 12:26:51 -04:00
Russ Cox
846a368b88 gofix: be more conservative about rewrite to os.Create
Rewrite only if we understood all the flags we saw.

R=r
CC=golang-dev
https://golang.org/cl/4376046
2011-04-08 10:59:25 -04:00
Alex Brainman
d976314776 gotest: handle \r\n returned by gomake on Windows (fixes build)
R=golang-dev, peterGo, rsc1
CC=Joe Poirier, golang-dev
https://golang.org/cl/4370048
2011-04-08 23:53:57 +10:00
Robert Griesemer
0ada4a2d62 go/types: fix build: use the right compiler to compile test case
R=rsc
CC=golang-dev
https://golang.org/cl/4369050
2011-04-07 22:10:39 -07:00
Robert Griesemer
1baffa7da0 gotype: use go/types GcImporter
R=rsc
CC=golang-dev
https://golang.org/cl/4358043
2011-04-07 21:42:30 -07:00
Robert Griesemer
a87382e7b3 go/types: New Go type hierarchy implementation for AST.
This CL defines a new, more Go-like representation of
Go types (different structs for different types as
opposed to a single Type node). It also implements
an ast.Importer for object/archive files generated
by the gc compiler tool chain. Besides the individual
type structs, the main difference is the handling of
named types: In the old world, a named type had a
non-nil *Object pointer but otherwise looked no
different from other types. In this new model, named
types have their own representation types.Name. As
a result, resolving cycles is a bit simpler during
construction, at the cost of having to deal with
types.Name nodes explicitly later. It remains to be
seen if this is a good approach. Nevertheless, code
involving types reads more nicely and benefits from
full type checking. Also, the representation seems
to more closely match the spec wording.

Credits: The original version of the gc importer was
written by Evan Shaw (chickencha@gmail.com). The new
version in this CL is based largely on Evan's original
code but contains bug fixes, a few simplifications,
some restructuring, and was adjusted to use the
new type hierarchy. I have added a comprehensive test
that imports all packages found under $GOROOT/pkg (with
a 3s time-out to limit the run-time of the test). Run
gotest -v for details.

The original version of ExportData (exportdata.go) was
written by Russ Cox (rsc@golang.org). The current version
is returning the internal buffer positioned at the beginning
of the export data instead of printing the export data to
stdout.

With the new types package, the existing in-progress
typechecker package is deprecated. I will delete it
once all functionality has been brought over.

R=eds, rog, rsc
CC=golang-dev
https://golang.org/cl/4314054
2011-04-07 21:40:37 -07:00
Robert Griesemer
70bf4215e9 scanner: better TokenString output
R=rsc
CC=golang-dev
https://golang.org/cl/4373048
2011-04-07 19:41:55 -07:00
Alex Brainman
776fd72579 test/bench: enable build and test on Windows
R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4366043
2011-04-08 10:43:25 +10:00
Alex Brainman
2683c76d95 misc/cgo/life: enable build and test on Windows
R=golang-dev, rsc1
CC=golang-dev, vcc
https://golang.org/cl/4374044
2011-04-08 10:35:35 +10:00
Alex Brainman
d3cd0c0752 syscall: fix Windows Signalled
Thanks to fhs.

R=golang-dev, r2
CC=ality, fhs, golang-dev
https://golang.org/cl/4375044
2011-04-08 10:27:47 +10:00
Russ Cox
35c880b1e2 gc: bug327
Fixes #1674.

R=ken2
CC=golang-dev
https://golang.org/cl/4368057
2011-04-07 18:53:47 -04:00
Russ Cox
62c24811e7 syscall: fix freebsd/386 again
TBR=r
CC=golang-dev
https://golang.org/cl/4380042
2011-04-07 15:44:10 -04:00
Russ Cox
62049366e7 syscall: freebsd/386 Syscall9 (fix build)
R=r
CC=golang-dev
https://golang.org/cl/4386042
2011-04-07 15:35:04 -04:00
Mikio Hara
c54ed66c75 syscall: fix build
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4368050
2011-04-07 12:03:45 -07:00
Mikkel Krautz
2aceea630f ld: fix Mach-O X86_64_RELOC_SIGNED relocations
Fixes #1658.

R=rsc
CC=golang-dev
https://golang.org/cl/4344066
2011-04-07 14:20:42 -04:00
Mikkel Krautz
cf3323f511 ld: fix Mach-O bss bug
Fixes #1559.

R=rsc
CC=golang-dev, peterGo, rog
https://golang.org/cl/4356046
2011-04-07 13:17:28 -04:00
Dave Cheney
b3a4d58ba8 syscall: fix typo in mmap comment
R=rsc
CC=golang-dev
https://golang.org/cl/4377043
2011-04-06 23:07:32 -04:00
Russ Cox
48ae1f2d9b syscall: add Mmap, Munmap on Linux, FreeBSD, OS X
* tweak mksyscall*.pl to be more gofmt-compatible.
* add mkall.sh -syscalls option.
* add sys/mman.h constants on OS X

R=r, eds, niemeyer
CC=golang-dev
https://golang.org/cl/4369044
2011-04-06 17:52:02 -04:00
Albert Strasheim
c45a08e5ba syscall: Add DT_* and MADV_* constants on Linux.
R=rsc, agl1
CC=golang-dev
https://golang.org/cl/4370041
2011-04-06 16:19:22 -04:00
Russ Cox
cf56f06ab6 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
2011-04-06 15:44:40 -04:00
Rob Pike
1e1e2f0971 exec: add a little package commentary explaining its
relationship to os.Process.

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4384041
2011-04-06 12:37:17 -07:00
Russ Cox
2671ddd10b fix build (sorry)
TBR=r
CC=golang-dev
https://golang.org/cl/4378042
2011-04-06 15:13:18 -04:00
Russ Cox
0ea7bf4867 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
2011-04-06 15:06:28 -04:00
Rob Pike
5ee13c0d59 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
2011-04-06 11:48:03 -07:00
Adam Langley
41971434d1 crypto/rsa: add 3-prime support.
R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4365041
2011-04-06 14:11:56 -04:00
Adam Langley
057bdfe39d 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
2011-04-06 10:22:04 -04:00
Alex Brainman
7f7371e95b pkg/path: enable tests on Windows
Fixes #1107.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4374041
2011-04-06 16:45:20 +10:00
Andrew Gerrand
b44dbff8c8 http: allow override of Content-Type for ServeFile
R=bradfitz, bradfitzwork
CC=golang-dev
https://golang.org/cl/4368041
2011-04-06 14:52:42 +10:00
Adam Langley
360ab50a9b 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
2011-04-05 18:07:01 -04:00
Dmitry Chestnykh
9f1394d270 crypto/ecdsa, crypto/rsa: use io.ReadFull to read from random source.
R=golang-dev, agl1
CC=golang-dev
https://golang.org/cl/4316057
2011-04-05 17:11:31 -04:00
Rob Pike
63e28ae4ab gotest: fix windows build.
R=rsc
CC=golang-dev
https://golang.org/cl/4339055
2011-04-05 13:51:49 -07:00
Rob Pike
88a8ac08b9 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
2011-04-05 12:51:10 -07:00
Adam Langley
906b2e7679 crypto/des: cleanups
R=rsc
CC=golang-dev
https://golang.org/cl/4315050
2011-04-05 15:40:48 -04:00
Adam Langley
2db1769d7b crypto/block: remove deprecated package.
R=rsc
CC=golang-dev
https://golang.org/cl/4315051
2011-04-05 15:23:40 -04:00
Peter Mundy
b2bf14acd9 gotest: fixes for [^.]_test file pattern
R=rsc, r
CC=golang-dev
https://golang.org/cl/4339054
2011-04-05 11:49:44 -07:00
Russ Cox
de3aac609c gofix: don't rewrite O_APPEND opens
R=r, rog
CC=golang-dev
https://golang.org/cl/4364041
2011-04-05 11:12:02 -04:00
Yasuhiro Matsumoto
7098f3d442 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
2011-04-05 10:59:10 -04:00
Rob Pike
80c5ef9f31 os: fix windows build
R=brainman
CC=golang-dev
https://golang.org/cl/4308047
2011-04-04 23:57:08 -07:00
Rob Pike
8a90fd3c72 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
2011-04-04 23:42:14 -07:00
Brad Fitzpatrick
6e4966eb7f 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
2011-04-04 19:43:36 -07:00
Brad Fitzpatrick
243266f62e 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
2011-04-04 19:22:47 -07:00
Mikio Hara
f3ad899a2d net: fix typo
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4315049
2011-04-05 11:35:16 +10:00
Gustavo Niemeyer
94e60061eb filepath: new Abs function
R=golang-dev, rsc1, peterGo, bsiegert, r, mattn
CC=golang-dev
https://golang.org/cl/4271057
2011-04-04 18:29:24 -07:00
Brad Fitzpatrick
7c9c4fc3a1 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
2011-04-04 16:58:11 -07:00
Brad Fitzpatrick
2be13a80c7 os: add Seek whence constants
R=r, r2, rsc1, rsc, jacek.masiulaniec
CC=golang-dev
https://golang.org/cl/4344062
2011-04-04 13:53:52 -07:00
Russ Cox
d3ca620baf gotest: fix build
TBR=r
CC=golang-dev
https://golang.org/cl/4351047
2011-04-04 16:35:40 -04:00
Rob Pike
60c4c3464b 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
2011-04-04 13:09:34 -07:00
Evan Shaw
06ee80d6eb 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
2011-04-04 15:57:10 -04:00
Matt Jones
5fd0a74987 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
2011-04-04 15:49:49 -04:00
Albert Strasheim
492039ae7f os: Fix MkdirAll("/thisdoesnotexist").
Fixes #1637.

R=rsc, rh, msolo
CC=golang-dev
https://golang.org/cl/4317049
2011-04-04 15:45:03 -04:00
Mikio Hara
5a59b9eba3 syscall: add BPF support for freebsd/386, freebsd/amd64
R=rsc
CC=golang-dev
https://golang.org/cl/4331050
2011-04-04 15:40:40 -04:00
Brad Fitzpatrick
cc40870f4b httptest: add NewTLSServer
Enables the use of https servers in tests.

R=agl, rsc, agl1
CC=golang-dev
https://golang.org/cl/4284063
2011-04-04 08:32:59 -07:00
Brad Fitzpatrick
a2bcd3814d 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
2011-04-04 08:10:26 -07:00
Andrew Gerrand
0f46aaf8b3 version.bash: strip changeset hash from 'hg tags' output
Fixes #1651.

R=rsc
CC=golang-dev
https://golang.org/cl/4300054
2011-04-04 10:06:09 +10:00
Andrey Mirtchovski
fbeaa869f6 path/filepath: add support for plan9
R=paulzhol, ality, r, fhs
CC=golang-dev
https://golang.org/cl/4316054
2011-04-03 09:11:41 -07:00
Andrey Mirtchovski
69819c2ea3 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
2011-04-03 08:52:43 -07:00
Ian Lance Taylor
60cfb63bd4 Make.pkg: increase test timeout to 120 seconds.
R=r, peterGo
CC=golang-dev
https://golang.org/cl/4344053
2011-04-02 22:23:34 -07:00
Yuval Pavel Zholkover
c256f0a4b3 os: Plan 9 support.
R=rsc, ality, r, r2
CC=golang-dev
https://golang.org/cl/4149046
2011-04-02 14:28:58 -07:00
Yuval Pavel Zholkover
1cc4a5cd94 R=rsc, brainman, ality, r2, r
CC=golang-dev
https://golang.org/cl/3816043
2011-04-02 14:24:03 -07:00
Robert Griesemer
c42b3e21c3 go/parser: package name must not be the blank identifier
R=r, r2, rsc1
CC=golang-dev
https://golang.org/cl/4343045
2011-04-01 20:51:55 -07:00
Evan Shaw
7b40095e8c 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
2011-04-01 22:26:57 -04:00
Russ Cox
6865cc0e8e gc: avoid saying same error 3 times
R=ken2
CC=golang-dev
https://golang.org/cl/4316051
2011-04-01 20:52:38 -04:00
Evan Shaw
46137557c4 syscall: make Syscall6 pass 6th arg on linux/386
R=rsc
CC=golang-dev
https://golang.org/cl/4350043
2011-04-01 20:46:01 -04:00
Rob Pike
a78a25a16b path/filepath.Glob: don't drop known matches on error.
Fixes #1610.

R=rsc
CC=golang-dev
https://golang.org/cl/4355042
2011-04-01 09:58:05 -07:00
Alex Brainman
799be52b35 gotest: another attempt to make it run on Windows
R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4347041
2011-04-01 13:38:33 +11:00
Alex Brainman
6c651728d8 gotest: execute gomake properly on Windows
R=peterGo, rsc, Joe Poirier
CC=golang-dev
https://golang.org/cl/4280087
2011-04-01 10:10:15 +11:00
Ian Lance Taylor
554082d6b1 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
2011-03-31 15:27:51 -07:00
Rob Pike
3907031358 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
2011-03-31 14:56:01 -07:00
Brad Fitzpatrick
883048daab http: add Transport.MaxIdleConnsPerHost
R=rsc
CC=golang-dev
https://golang.org/cl/4280079
2011-03-31 12:58:50 -07:00
Alexey Borzenkov
10694c81b0 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
2011-03-31 15:16:18 +11:00
Rob Pike
7d77e3117c 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
2011-03-30 21:14:49 -07:00
Russ Cox
5a7a074261 gopack: comment out debugging print
TBR=r
CC=golang-dev
https://golang.org/cl/4333048
2011-03-30 22:41:32 -04:00
Russ Cox
3d2e57a312 gopack: add P flag to remove prefix from filename information
R=r, r2
CC=golang-dev
https://golang.org/cl/4307047
2011-03-30 22:19:02 -04:00
Russ Cox
b66b22cdd4 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
2011-03-30 22:12:30 -04:00
Robert Griesemer
7a5bbfd47f 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
2011-03-30 15:27:23 -07:00
Robert Griesemer
e64d337726 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
2011-03-30 15:26:53 -07:00
Robert Griesemer
61aaadf217 gotest: exclude . files when parsing directories (per r's suggestion)
R=r, rsc1, iant2
CC=golang-dev
https://golang.org/cl/4329044
2011-03-30 09:46:11 -07:00
Roger Peppe
dba96cf411 go/parser: fix scoping for local type declarations
R=gri
CC=golang-dev
https://golang.org/cl/4332045
2011-03-30 09:45:51 -07:00
Andrew Gerrand
6b567d26b7 godoc: remove errant space in HTML tag
R=gri
CC=golang-dev
https://golang.org/cl/4277087
2011-03-30 16:41:41 +11:00
Robert Griesemer
1afc37fa7e 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
2011-03-29 18:30:59 -07:00
Andrew Gerrand
d54c4ecc32 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
2011-03-30 11:40:00 +11:00
Adam Langley
974d2c98e0 crypto/tls: extend NPN support to the client.
R=bradfitzgo, rsc1, bradfitzwork
CC=golang-dev
https://golang.org/cl/4277085
2011-03-29 17:53:09 -04:00
Rob Pike
d844aae690 prints: fix a couple of formatting errors caught by govet
R=rsc, agl, agl1
CC=golang-dev
https://golang.org/cl/4337041
2011-03-29 14:03:08 -07:00
Rob Pike
fb80f63cf7 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
2011-03-29 13:29:20 -07:00
Rob Pike
518c0adb17 govet: fix bug introduced at 4313054
R=rsc, gri
CC=golang-dev
https://golang.org/cl/4336042
2011-03-29 13:18:52 -07:00
Rob Pike
f61b7e5dc5 gotry: move into its own directory, separate from gotest.
R=rsc
CC=golang-dev
https://golang.org/cl/4327045
2011-03-29 13:00:24 -07:00
Rob Pike
62ed6ee6c4 ngotest: correctly handle packages with tests outside the package.
R=rsc
CC=golang-dev
https://golang.org/cl/4330043
2011-03-29 12:50:41 -07:00
Adam Langley
9225bbfc0c crypto/cipher: bad CTR IV length now triggers panic
R=rsc
CC=golang-dev
https://golang.org/cl/4326042
2011-03-29 15:47:35 -04:00
Albert Strasheim
d41d6fec10 syscall: StartProcess Chroot and Credential.
R=rsc, iant, agl1
CC=golang-dev
https://golang.org/cl/4280065
2011-03-29 14:29:22 -04:00
Alexey Borzenkov
0793176451 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
2011-03-29 14:23:42 -04:00
David Forsythe
85c79ef7cb os: fix FileInfo.Name returned by Stat
Fixes #1645.

R=rsc
CC=golang-dev
https://golang.org/cl/4321045
2011-03-29 14:23:36 -04:00
Rob Pike
d74ff67cc8 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
2011-03-29 10:41:23 -07:00
Rob Pike
e393efc499 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
2011-03-29 10:11:33 -07:00
Robert Griesemer
536531769b CL 4291070: incorporating rsc's feedback
R=rsc
CC=golang-dev
https://golang.org/cl/4313054
2011-03-29 09:08:23 -07:00
Mikkel Krautz
a7bb288f99 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
2011-03-29 10:35:34 -04:00
Adam Langley
054516338a 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
2011-03-29 10:33:47 -04:00
Evan Shaw
47f4ae1a78 bytes, strings: simplify Join
R=gri, rsc
CC=golang-dev
https://golang.org/cl/4300044
2011-03-29 01:27:38 -04:00
Alexey Borzenkov
2f45f72dce 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
2011-03-28 23:40:01 -04:00
Russ Cox
98828f033a fix build
TBR=adg
CC=golang-dev
https://golang.org/cl/4322041
2011-03-28 23:39:39 -04:00
Russ Cox
2a1b4a83fc gofix: netdial
R=adg
CC=golang-dev
https://golang.org/cl/4278053
2011-03-28 23:29:00 -04:00
Russ Cox
5546cc7eab update tree for package net changes
Converted with gofix.

R=adg
CC=golang-dev
https://golang.org/cl/4284049
2011-03-28 23:28:53 -04:00
Russ Cox
41f93a430f 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
2011-03-28 23:28:42 -04:00
Robert Griesemer
5a3aae4bf7 go/printer, gofmt: rely on existing line breaks when formatting expression lists
No impact on existing sources.

Fixes #1632.

R=rsc
CC=golang-dev
https://golang.org/cl/4271083
2011-03-28 18:48:52 -07:00
Robert Griesemer
b2658452a6 go/scanner: return literal as string instead of []byte
Removed many string conversions in dependent code.
Runs all tests. No change to gofmt output.

R=r
CC=golang-dev
https://golang.org/cl/4291070
2011-03-28 16:44:28 -07:00
Robert Griesemer
2796ac1466 go/token: use array instead of map for token->string table
R=rsc
CC=golang-dev
https://golang.org/cl/4284070
2011-03-28 13:38:24 -07:00
Ian Lance Taylor
0caa0c0923 net: let OS-specific AddFD routine wake up polling thread.
With gccgo some operating systems require using select rather
than epoll or kevent.  Using select means that we have to wake
up the polling thread each time we add a new file descriptor.
This implements that in the generic code rather than adding
another wakeup channel, even though nothing in the current net
package uses the capability.

R=rsc, iant2
CC=golang-dev
https://golang.org/cl/4284069
2011-03-28 12:39:09 -07:00
Robert Griesemer
5be77a204b go/ast: implemented NewPackage
NewPackage creates an ast.Package node from
a set of package files and resolves unresolved
identifiers.

Also:
- Changed semantics of Scope.Insert: If an
  object is inserted w/o errors, the result
  is nil (before it was obj).
- Fixed an identifier resolution bug in the
  parser: map keys must not be resolved.

gotype runs through several go/* packages
and successfully resolves all (non-field/method)
identifiers.

R=rog, rsc
CC=golang-dev
https://golang.org/cl/4298044
2011-03-28 10:46:26 -07:00
Brad Fitzpatrick
a7a854b82f strings: Map: avoid allocation when string is unchanged
This speeds up strings.ToLower, etc.

before/after:
strings_test.BenchmarkMapNoChanges 1000000 1013 ns/op
strings_test.BenchmarkMapNoChanges 5000000  442 ns/op

R=r, rog, eh, rsc
CC=golang-dev
https://golang.org/cl/4306056
2011-03-28 09:41:57 -07:00
Luuk van Dijk
43512e6c70 runtime: fix gdb support for goroutines.
in gdb, 'info goroutines' and 'goroutine <n> <cmd> were crashing
because the 'g' and 'm' structures had changed a bit.

R=rsc
CC=golang-dev
https://golang.org/cl/4289077
2011-03-28 17:34:22 +02:00
Russ Cox
6b3357129a build: add all-qemu.bash, handful of arm fixes
R=r
CC=golang-dev
https://golang.org/cl/4313051
2011-03-27 23:39:42 -04:00
Russ Cox
732f2fa2c1 http: avoid crash when asked for multiple file ranges
R=adg
CC=golang-dev
https://golang.org/cl/4289076
2011-03-27 23:35:31 -04:00
Alexey Borzenkov
59a8926829 runtime: fix darwin/amd64 thread VM footprint
On darwin amd64 it was impossible to create more that ~132 threads. While
investigating I noticed that go consumes almost 1TB of virtual memory per
OS thread and the reason for such a small limit of OS thread was because
process was running out of virtual memory. While looking at bsdthread_create
I noticed that on amd64 it wasn't using PTHREAD_START_CUSTOM.
If you look at http://fxr.watson.org/fxr/source/bsd/kern/pthread_synch.c?v=xnu-1228
you will see that in that case darwin will use stack pointer as stack size,
allocating huge amounts of memory for stack. This change fixes the issue
and allows for creation of up to 2560 OS threads (which appears to be some
Mac OS X limit) with relatively small virtual memory consumption.

R=rsc
CC=golang-dev
https://golang.org/cl/4289075
2011-03-27 17:15:48 -04:00
Rob Pike
7f9acb53cb testing: shorten some more tests
R=rsc
CC=golang-dev
https://golang.org/cl/4314044
2011-03-26 11:25:22 -07:00
Robert Hencke
a4df525a79 gob: trivial cleanup
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4279074
2011-03-25 20:45:21 -07:00
Ian Lance Taylor
2795b13156 gc: remove interim ... error which rejects valid code.
It's been six months.

R=rsc
CC=golang-dev
https://golang.org/cl/4289073
2011-03-25 18:31:55 -07:00
Rob Pike
f0cf7d296c testing: shorten some tests.
These are the top runners.  More to come.
Also print two digits of timing info under -test.v.

R=rsc
CC=golang-dev
https://golang.org/cl/4317044
2011-03-25 16:31:10 -07:00
Dave Cheney
d165dc6036 build: handle broken awk in version.bash
R=adg, rsc, ality
CC=golang-dev
https://golang.org/cl/4281069
2011-03-25 18:00:19 -04:00
Rob Pike
d406f8f650 testing: set up structure for faster testing using the new -test.short flag.
New make target "testshort" runs "gotest -test.short" and is invoked
by run.bash, which is invoked by all.bash.

Use -test.short to make one package (crypto ecdsa) run much faster.
More changes to come.

Once this is in, I will update the long-running tests to use the new flag.

R=rsc
CC=golang-dev
https://golang.org/cl/4317043
2011-03-25 14:50:44 -07:00
Peter Mundy
91bcdb620b net: fix Windows build
R=rsc
CC=golang-dev
https://golang.org/cl/4314042
2011-03-25 16:11:19 -04:00
Albert Strasheim
e83d69647f syscall: GetsockoptInt for darwin, freebsd.
R=rsc
CC=golang-dev
https://golang.org/cl/4298060
2011-03-25 14:43:59 -04:00
Albert Strasheim
e480b81971 net: add FileConn, FilePacketConn, FileListener
R=iant, rsc, brainman
CC=golang-dev
https://golang.org/cl/4306042
2011-03-25 14:42:25 -04:00
Rob Pike
9db2bc741e flag: fix error in documentation example.
Fixes #1615.
This time for sure.

R=rsc, gri
CC=golang-dev
https://golang.org/cl/4275079
2011-03-25 11:28:31 -07:00
Russ Cox
071d212a22 runtime/pprof: disable test on darwin
Fixes #1641.

Actually it side steps the real issue, which is that the
setitimer(2) implementation on OS X is not useful for
profiling of multi-threaded programs.  I filed the below
using the Apple Bug Reporter.

/*
Filed as Apple Bug Report #9177434.

This program creates a new pthread that loops, wasting cpu time.
In the main pthread, it sleeps on a condition that will never come true.
Before doing so it sets up an interval timer using ITIMER_PROF.
The handler prints a message saying which thread it is running on.

POSIX does not specify which thread should receive the signal, but
in order to be useful in a user-mode self-profiler like pprof or gprof
   http://code.google.com/p/google-perftools
   http://www.delorie.com/gnu/docs/binutils/gprof_25.html
it is important that the thread that receives the signal is the one
whose execution caused the timer to expire.

Linux and FreeBSD handle this by sending the signal to the process's
queue but delivering it to the current thread if possible:

   http://lxr.linux.no/linux+v2.6.38/kernel/signal.c#L802
     807        /*
     808         * Now find a thread we can wake up to take the signal off the queue.
     809         *
     810         * If the main thread wants the signal, it gets first crack.
     811         * Probably the least surprising to the average bear.
     812         * /

   http://fxr.watson.org/fxr/source/kern/kern_sig.c?v=FREEBSD8;im=bigexcerpts#L1907
     1914         /*
     1915          * Check if current thread can handle the signal without
     1916          * switching context to another thread.
     1917          * /

On those operating systems, this program prints:

    $ ./a.out
    signal on cpu-chewing looper thread
    signal on cpu-chewing looper thread
    signal on cpu-chewing looper thread
    signal on cpu-chewing looper thread
    signal on cpu-chewing looper thread
    signal on cpu-chewing looper thread
    signal on cpu-chewing looper thread
    signal on cpu-chewing looper thread
    signal on cpu-chewing looper thread
    signal on cpu-chewing looper thread
    $

The OS X kernel does not have any such preference.  Its get_signalthread
does not prefer current_thread(), in contrast to the other two systems,
so the signal gets delivered to the first thread in the list that is able to
handle it, which ends up being the main thread in this experiment.
http://fxr.watson.org/fxr/source/bsd/kern/kern_sig.c?v=xnu-1456.1.26;im=excerpts#L1666

    $ ./a.out
    signal on sleeping main thread
    signal on sleeping main thread
    signal on sleeping main thread
    signal on sleeping main thread
    signal on sleeping main thread
    signal on sleeping main thread
    signal on sleeping main thread
    signal on sleeping main thread
    signal on sleeping main thread
    signal on sleeping main thread
    $

The fix is to make get_signalthread use the same heuristic as
Linux and FreeBSD, namely to use current_thread() if possible
before scanning the process thread list.

*/

#include <sys/time.h>
#include <sys/signal.h>
#include <pthread.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

static void handler(int);
static void* looper(void*);

static pthread_t pmain, ploop;

int
main(void)
{
        struct itimerval it;
        struct sigaction sa;
        pthread_cond_t cond;
        pthread_mutex_t mu;

        memset(&sa, 0, sizeof sa);
        sa.sa_handler = handler;
        sa.sa_flags = SA_RESTART;
        memset(&sa.sa_mask, 0xff, sizeof sa.sa_mask);
        sigaction(SIGPROF, &sa, 0);

        pmain = pthread_self();
        pthread_create(&ploop, 0, looper, 0);

        memset(&it, 0, sizeof it);
        it.it_interval.tv_usec = 10000;
        it.it_value = it.it_interval;
        setitimer(ITIMER_PROF, &it, 0);

        pthread_mutex_init(&mu, 0);
        pthread_mutex_lock(&mu);

        pthread_cond_init(&cond, 0);
        for(;;)
                pthread_cond_wait(&cond, &mu);

        return 0;
}

static void
handler(int sig)
{
        static int nsig;
        pthread_t p;

        p = pthread_self();
        if(p == pmain)
                printf("signal on sleeping main thread\n");
        else if(p == ploop)
                printf("signal on cpu-chewing looper thread\n");
        else
                printf("signal on %p\n", (void*)p);
        if(++nsig >= 10)
                exit(0);
}

static void*
looper(void *v)
{
        for(;;);
}

R=r
CC=golang-dev
https://golang.org/cl/4273113
2011-03-25 13:47:07 -04:00
Ian Lance Taylor
7c616b3809 runtime: always set *received in chanrecv.
Also fix comment.

The only caller of chanrecv initializes the value to false, so
this patch makes no difference at present.  But it seems like
the right thing to do.

R=rsc
CC=golang-dev
https://golang.org/cl/4312053
2011-03-25 10:36:22 -07:00
Ian Lance Taylor
f6d0e81179 runtime/darwin: remove unused local variables.
R=rsc
CC=golang-dev
https://golang.org/cl/4309049
2011-03-25 10:35:46 -07:00
Russ Cox
e857dd5d3f http/pprof: cpu profiling support
R=r
CC=golang-dev
https://golang.org/cl/4280060
2011-03-25 12:50:12 -04:00
Roger Pau Monné
500effe79e http: modified perl cgi test to remove newline from env variables
Fixes #1639

R=golang-dev, bradfitzgo
CC=golang-dev
https://golang.org/cl/4291069
2011-03-25 09:33:45 -07:00
Russ Cox
1f2234633f runtime: fix arm build
R=adg, dfc, r
CC=golang-dev
https://golang.org/cl/4296042
2011-03-25 12:30:49 -04:00
Devon H. O'Dell
e37892c36c freebsd-386: update defs
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4273102
2011-03-25 10:18:04 +11:00
Robert Griesemer
1b2c3e664b go/parser: resolve identifiers properly
Correctly distinguish between lhs and rhs identifiers
and resolve/declare them accordingly.

Collect field and method names in respective scopes
(will be available after some minor AST API changes).

Also collect imports since it's useful to have that
list directly w/o having to re-traverse the AST
(will also be available after some minor AST API changes).

No external API changes in this CL.

R=rsc, rog
CC=golang-dev
https://golang.org/cl/4271061
2011-03-24 11:45:52 -07:00
Rob Pike
d1b75bbc46 gob: remove another allocation.
The top level bytes.Buffer is always there and can be re-used.
Rpc goes from 83 to 79 mallocs per round trip.

R=rsc
CC=golang-dev
https://golang.org/cl/4271062
2011-03-23 21:49:19 -07:00
Andrew Gerrand
1c05a90ae2 runtime: fix freebsd-amd64 (and part of 386)
R=rsc
CC=golang-dev
https://golang.org/cl/4285063
2011-03-24 11:45:12 +11:00
Alex Brainman
913c8d7397 syscall: StartProcess fixes for windows
- StartProcess will work with relative (to attr.Dir, not
  current directory) executable filenames
- StartProcess will only work if executable filename points
  to the real file, it will not search for executable in the
  $PATH list and others (see CreateProcess manual for details)
- StartProcess argv strings can contain any characters

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4306041
2011-03-24 11:20:28 +11:00
Russ Cox
543acc97f9 testing: add -test.cpuprofile flag
R=r
CC=golang-dev
https://golang.org/cl/4272066
2011-03-23 18:17:14 -04:00
Luuk van Dijk
14b9032f84 5l/6l/8l: undo spadj cleanup at ARET for following instructions in the same stackframe.
5l was already correct, clarified comment and added diags for unmaintained code.

R=rsc
CC=golang-dev
https://golang.org/cl/4277070
2011-03-23 23:11:29 +01:00
Brad Fitzpatrick
9d3b39986c http: don't chunk 304 responses
rsc's earlier fix, plus tests.

R=rsc
CC=golang-dev
https://golang.org/cl/4285062
2011-03-23 14:29:26 -07:00
Brad Fitzpatrick
054a0c338f gotest: fix gofmt issue in generated _testmain.go
R=rsc, r
CC=golang-dev
https://golang.org/cl/4287074
2011-03-23 14:23:05 -07:00
Albert Strasheim
c6810e76ed syscall: GetsockoptInt.
R=rsc, iant
CC=golang-dev
https://golang.org/cl/4271060
2011-03-23 14:33:48 -04:00
Russ Cox
f2483c74f6 gofmt: add profiling flag
R=gri
CC=golang-dev
https://golang.org/cl/4295062
2011-03-23 14:28:38 -04:00
Russ Cox
b47ec598b7 runtime/pprof: cpu profiling support
R=r, bradfitzgo, r2
CC=golang-dev
https://golang.org/cl/4313041
2011-03-23 13:54:31 -04:00
Brad Fitzpatrick
059c07cab0 http: export Transport, add keep-alive support
This patch adds a connection cache and keep-alive
support to Transport, which is used by the
HTTP client.

It's also structured such that it's easy to add
HTTP pipelining in the future.

R=rsc, petar-m, bradfitzwork, r
CC=golang-dev
https://golang.org/cl/4272045
2011-03-23 10:38:18 -07:00
Russ Cox
c19b373c8a runtime: cpu profiling support
R=r
CC=golang-dev
https://golang.org/cl/4306043
2011-03-23 11:43:37 -04:00
Russ Cox
f9fc1ddf75 runtime: fix print - no %v in C
R=r
CC=golang-dev
https://golang.org/cl/4280061
2011-03-23 11:34:03 -04:00
Russ Cox
fba0606220 godefs: handle volatile
R=iant
CC=golang-dev
https://golang.org/cl/4291063
2011-03-23 11:33:53 -04:00
Russ Cox
8dee872963 runtime: os-specific types and code for setitimer
R=r
CC=golang-dev
https://golang.org/cl/4273097
2011-03-23 11:31:42 -04:00
Russ Cox
ccdbb8a6c2 runtime: more stack split fixes
Found by stkcheck after 6l, 8l bug fixes Luuk is about to submit.

R=lvd
CC=golang-dev
https://golang.org/cl/4306047
2011-03-23 11:28:24 -04:00
Andrew Gerrand
39ffd546bd sync: fix example code
Fixes #1631.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4303046
2011-03-23 14:24:30 +11:00
Ken Thompson
a73817716a chan: allocate a new chan with one
malloc rather than nelements + 1.

R=rob
CC=golang-dev
https://golang.org/cl/4291064
2011-03-22 18:41:17 -07:00
Andrew Gerrand
005fe41125 godoc: add -template flag to specify custom templates
R=gri, niemeyer, rsc1
CC=golang-dev
https://golang.org/cl/4291059
2011-03-23 09:44:23 +11:00