]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agodoc: update install docs for Windows and Go 1, add golang-announce to /project
Andrew Gerrand [Tue, 6 Mar 2012 04:16:02 +0000 (15:16 +1100)]
doc: update install docs for Windows and Go 1, add golang-announce to /project

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

13 years agogo/build: add dependency test
Russ Cox [Tue, 6 Mar 2012 04:13:00 +0000 (23:13 -0500)]
go/build: add dependency test

This exercises the Import function but more importantly
gives us a place to write down the policy for dependencies
within the Go tree.  It also forces us to look at the dependencies,
which may lead to adjustments.

Surprises:
 - go/doc imports text/template, for HTMLEscape (could fix)
 - it is impossible to use math/big without fmt (unfixable)
 - it is impossible to use crypto/rand without math/big (unfixable)

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

13 years agounicode/utf16: delete dependence on package unicode
Rob Pike [Tue, 6 Mar 2012 03:58:08 +0000 (14:58 +1100)]
unicode/utf16: delete dependence on package unicode
In the test, verify the copied constants are correct.
Also put the test into package utf16 rather than utf16_test;
the old location was probably due creating the test from
utf8, but the separation is not needed here.

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

13 years agocmd/godoc: fixes
Russ Cox [Tue, 6 Mar 2012 03:47:35 +0000 (22:47 -0500)]
cmd/godoc: fixes

These appear to have been left out of the CL I submitted earlier.

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

13 years agobuild: use run.go for running tests
Russ Cox [Tue, 6 Mar 2012 03:47:23 +0000 (22:47 -0500)]
build: use run.go for running tests

Also, tweak run.go to use no more than 2x the
number of CPUs, and only one on ARM.

53.85u 13.33s 53.69r   ./run
50.68u 12.13s 18.85r   go run run.go

Fixes #2833.

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

13 years agoruntime: add Compiler
Russ Cox [Tue, 6 Mar 2012 03:28:02 +0000 (22:28 -0500)]
runtime: add Compiler

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

13 years agonet: silence another epoll print
Russ Cox [Tue, 6 Mar 2012 03:07:22 +0000 (22:07 -0500)]
net: silence another epoll print

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

13 years agodoc: add more gophers
Andrew Gerrand [Tue, 6 Mar 2012 01:50:52 +0000 (12:50 +1100)]
doc: add more gophers

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

13 years agonet: fix windows build
Mikio Hara [Tue, 6 Mar 2012 01:07:08 +0000 (10:07 +0900)]
net: fix windows build

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

13 years agonet: improve server and file tests
Mikio Hara [Tue, 6 Mar 2012 00:43:45 +0000 (09:43 +0900)]
net: improve server and file tests

* Splits into three server tests.
  - TestStreamConnServer for tcp, tcp4, tcp6 and unix networks
  - TestSeqpacketConnServer for unixpacket networks
  - TestDatagramPacketConnServer for udp, udp4, udp6 and unixgram networks
* Adds both PacketConn and Conn test clients to datagram packet conn tests.
* Fixes wildcard listen test cases on dual IP stack platform.

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

13 years agotest: match gccgo error messages for bug388.go
Ian Lance Taylor [Tue, 6 Mar 2012 00:21:46 +0000 (16:21 -0800)]
test: match gccgo error messages for bug388.go

As runtime.UintType is no longer defined, the gccgo error
messages have changed.

bug388.go:12:10: error: reference to undefined identifier ‘runtime.UintType’
bug388.go:12:10: error: invalid named/anonymous mix
bug388.go:13:21: error: reference to undefined identifier ‘runtime.UintType’
bug388.go:17:10: error: reference to undefined identifier ‘runtime.UintType’
bug388.go:18:18: error: reference to undefined identifier ‘runtime.UintType’
bug388.go:22:9: error: non-name on left side of ‘:=’
bug388.go:27:10: error: expected type
bug388.go:32:9: error: expected type
bug388.go:23:14: error: reference to field ‘i’ in object which has no fields or methods

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

13 years agounicode/utf8: remove dependence on unicode.
Rob Pike [Tue, 6 Mar 2012 00:14:45 +0000 (11:14 +1100)]
unicode/utf8: remove dependence on unicode.
The dependency was there only to pull in two constants.
Now we define them locally and verify equality in the test.

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

13 years agoreflect: fix comment spacing
Ian Lance Taylor [Mon, 5 Mar 2012 23:51:58 +0000 (15:51 -0800)]
reflect: fix comment spacing

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

13 years agomisc/xcode: fix typos
Robert Griesemer [Mon, 5 Mar 2012 23:50:48 +0000 (15:50 -0800)]
misc/xcode: fix typos

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

13 years agoXcode: Example install of language specification for Xcode 4.x.
Emil Hessman [Mon, 5 Mar 2012 23:11:08 +0000 (15:11 -0800)]
Xcode: Example install of language specification for Xcode 4.x.

go.xclangspec is identical to the one in misc/xcode/3/, except for the heading.

Partial workaround for issue 2401.

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

13 years agoC+A: adding c.emil.hessman@gmail.com
Robert Griesemer [Mon, 5 Mar 2012 23:10:58 +0000 (15:10 -0800)]
C+A: adding c.emil.hessman@gmail.com

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

13 years agoexpvar: add locking to String, and use RWMutex properly throughout.
David Symonds [Mon, 5 Mar 2012 22:13:26 +0000 (09:13 +1100)]
expvar: add locking to String, and use RWMutex properly throughout.

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

13 years agomisc/dist: add windows packaging support
Andrew Gerrand [Mon, 5 Mar 2012 21:55:53 +0000 (08:55 +1100)]
misc/dist: add windows packaging support

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

13 years agoruntime: wait for main goroutine before setting GOMAXPROCS.
Rémy Oudompheng [Mon, 5 Mar 2012 21:40:27 +0000 (16:40 -0500)]
runtime: wait for main goroutine before setting GOMAXPROCS.

Fixes #3182.

R=golang-dev, dvyukov, rsc
CC=golang-dev, remy
https://golang.org/cl/5732057

13 years agonet: remove all direct fmt and bytes imports
Brad Fitzpatrick [Mon, 5 Mar 2012 21:36:05 +0000 (13:36 -0800)]
net: remove all direct fmt and bytes imports

Once dnsMsg stops using reflect, we lose even more
indirect dependencies.

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

13 years agocmd/gc: if $GOROOT_FINAL is set, rewrite file names in object files
Russ Cox [Mon, 5 Mar 2012 21:13:33 +0000 (16:13 -0500)]
cmd/gc: if $GOROOT_FINAL is set, rewrite file names in object files

GOROOT_FINAL is a build parameter that means "eventually
the Go tree will be installed here".  Make the file name information
match that eventual location.

Fixes #3180.

R=ken, ken
CC=golang-dev
https://golang.org/cl/5742043

13 years agoruntime/debug: fix test when source cannot be found
Russ Cox [Mon, 5 Mar 2012 21:13:15 +0000 (16:13 -0500)]
runtime/debug: fix test when source cannot be found

This happens with GOROOT_FINAL=/somewhere/else

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

13 years agocmd/godoc: remove extra / in paths
Ugorji Nwoke [Mon, 5 Mar 2012 20:36:33 +0000 (15:36 -0500)]
cmd/godoc: remove extra / in paths

If I click on links which should send you to source code (e.g. type, function, etc),
the link is to //src/... (instead of /src/...).
This causes a DNS resolution failure on the browser.

Quick fix is to remove the leading / from package.html
(since godoc.go src links automatically add a leading / as necessary).

Fixes #3193.

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

13 years agoA+C: Ugorji Nwoke (individual CLA)
Russ Cox [Mon, 5 Mar 2012 20:36:20 +0000 (15:36 -0500)]
A+C: Ugorji Nwoke (individual CLA)

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

13 years agonet: remove more use of fmt
Brad Fitzpatrick [Mon, 5 Mar 2012 20:20:58 +0000 (12:20 -0800)]
net: remove more use of fmt

Also add a TODO for the broken *dnsMsg String method.

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

13 years agomisc/emacs: fix extra indentation after comments that end with a period
Sameer Ajmani [Mon, 5 Mar 2012 19:58:35 +0000 (14:58 -0500)]
misc/emacs: fix extra indentation after comments that end with a period
in emacs go mode.  Thanks Alex Shinn for the patch.

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

13 years agonet: don't import bytes or fmt in mac.go
Brad Fitzpatrick [Mon, 5 Mar 2012 19:43:28 +0000 (11:43 -0800)]
net: don't import bytes or fmt in mac.go

Also add some more MAC tests.

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

13 years agocmd/go: sync type Package and go list doc
Russ Cox [Mon, 5 Mar 2012 19:41:30 +0000 (14:41 -0500)]
cmd/go: sync type Package and go list doc

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

13 years agotest/run.go: fix build
Shenghou Ma [Mon, 5 Mar 2012 19:34:53 +0000 (03:34 +0800)]
test/run.go: fix build

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

13 years agosyscall: fix mkall.sh, mksyscall_linux.pl, and regen for Linux/ARM
Shenghou Ma [Mon, 5 Mar 2012 19:12:11 +0000 (03:12 +0800)]
syscall: fix mkall.sh, mksyscall_linux.pl, and regen for Linux/ARM
CL 3075041 says ARM is not little-endian, but my test suggests otherwise.
My test program is:

    package main
    import ("fmt"; "syscall"; "os")
    func main() {
       err := syscall.Fallocate(1, 1/*FALLOC_FL_KEEP_SIZE*/, 0, int64(40960));
       fmt.Fprintln(os.Stderr, err)
    }

Without this CL, ./test > testfile will show: file too large; and strace shows:
    fallocate(1, 01, 0, 175921860444160)    = -1 EFBIG (File too large)
With this CL, ./test > testfile will show: <nil>; and strace shows:
    fallocate(1, 01, 0, 40960)              = 0

Quoting rsc:
"[It turns out that] ARM syscall ABI requires 64-bit arguments to use an
(even, odd) register pair, not an (odd, even) pair. Switching to "big-endian"
worked because it ended up using the high 32-bits (always zero in the tests
we had) as the padding word, because the 64-bit argument was the last one,
and because we fill in zeros for the rest of the system call arguments, up to
six. So it happened to work."

I updated mksyscall_linux.pl to accommodate the register pair ABI requirement,
and removed all hand-tweaked syscall routines in favor of the auto-generated
ones. These including: Ftruncate, Truncate, Pread and Pwrite.

Some recent Linux/ARM distributions do not bundle kernel asm headers,
so instead we always get latest asm/unistd.h from git.kernel.org (just like
what we do for FreeBSD).

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

13 years agoexpvar: add missing locking in String methods
Brad Fitzpatrick [Mon, 5 Mar 2012 19:09:50 +0000 (11:09 -0800)]
expvar: add missing locking in String methods

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

13 years agocmd/go: honor buildflags in go test.
Rémy Oudompheng [Mon, 5 Mar 2012 18:58:04 +0000 (19:58 +0100)]
cmd/go: honor buildflags in go test.

Fixes #3196.

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

13 years agocmd/gc: must not inline panic, recover
Russ Cox [Mon, 5 Mar 2012 18:51:44 +0000 (13:51 -0500)]
cmd/gc: must not inline panic, recover

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

13 years agocmd/gc: show duplicate key in error
Russ Cox [Mon, 5 Mar 2012 18:47:36 +0000 (13:47 -0500)]
cmd/gc: show duplicate key in error

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

13 years agocsv: clarify what a negative FieldsPerRecord means
Paul Borman [Mon, 5 Mar 2012 18:34:12 +0000 (13:34 -0500)]
csv: clarify what a negative FieldsPerRecord means

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

13 years agoencoding/json: document that nil slice encodes as `null`
Russ Cox [Mon, 5 Mar 2012 18:29:22 +0000 (13:29 -0500)]
encoding/json: document that nil slice encodes as `null`

Fixes #3189.

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

13 years agogodoc: quiet log spam
Russ Cox [Mon, 5 Mar 2012 18:29:13 +0000 (13:29 -0500)]
godoc: quiet log spam

Fixes #3191.
Sorry.

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

13 years agocrypto/x509: enforce path length constraint.
Adam Langley [Mon, 5 Mar 2012 17:08:42 +0000 (12:08 -0500)]
crypto/x509: enforce path length constraint.

An X.509 path length constrains the number of certificate that may
follow in the chain. This is a little simplistic for a first pass as it
doesn't check self-signed certificates (which don't count towards the
length), but it's conservatively simplistic.

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

13 years agocrypto/x509: don't include empty additional primes in PKCS#1 private key.
Adam Langley [Mon, 5 Mar 2012 17:04:18 +0000 (12:04 -0500)]
crypto/x509: don't include empty additional primes in PKCS#1 private key.

asn1 didn't have an omitempty tag, so the list of additional primes in
an RSA private key was serialised as an empty SEQUENCE, even for
version 1 structures. This tripped up external code that didn't handle
v2.

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

13 years agoencoding/asn1: handle UTCTime before the year 2000
Adam Langley [Mon, 5 Mar 2012 16:31:24 +0000 (11:31 -0500)]
encoding/asn1: handle UTCTime before the year 2000

UTCTime only has a two digit date field and year values from 50 should
be 1950, not 2050.

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

13 years agobuilder: use short test for subrepos
Shenghou Ma [Mon, 5 Mar 2012 15:16:11 +0000 (23:16 +0800)]
builder: use short test for subrepos

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

13 years agonet: make Dial and Listen behavior consistent across over platforms
Mikio Hara [Mon, 5 Mar 2012 15:13:10 +0000 (00:13 +0900)]
net: make Dial and Listen behavior consistent across over platforms

This CL changes the behavior of Dial and Listen API family.

Previous Dial and Listen allow a combo of "tcp6" and IPv4 or IPv6
IPv4-mapped address as its argument, but it also makes slightly
different behaviors between Linux and other platforms. This CL fixes
such differences across over platforms by tweaking IP-level socket
option IPV6_V6ONLY. Consequently new Dial and Listen API family will
reject arguments consists of "tcp6" and IPv4 or IPv6 IPv4-mapped
address.

This CL also adds a bit clarified unicast listener tests.

Fixes #2581.

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

13 years agogodoc: support $GOPATH, simplify file system code
Russ Cox [Mon, 5 Mar 2012 15:02:46 +0000 (10:02 -0500)]
godoc: support $GOPATH, simplify file system code

The motivation for this CL is to support $GOPATH well.
Since we already have a FileSystem interface, implement a
Plan 9-style name space.  Bind each of the $GOPATH src
directories onto the $GOROOT src/pkg directory: now
everything is laid out exactly like a normal $GOROOT and
needs very little special case code.

The filter files are no longer used (by us), so I think they
can just be deleted.  Similarly, the Mapping code and the
FileSystem interface were two different ways to accomplish
the same end, so delete the Mapping code.

Within the implementation, since FileSystem is defined to be
slash-separated, use package path consistently, leaving
path/filepath only for manipulating operating system paths.

I kept the -path flag, but I think it can be deleted too.

Fixes #2234.
Fixes #3046.

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

13 years agoencoding/binary: improve package comment.
Stefan Nilsson [Mon, 5 Mar 2012 15:02:30 +0000 (10:02 -0500)]
encoding/binary: improve package comment.

The current package comment doesn't mention varints and
protocol buffers. Also, the first sentence is incomprehensible
without further context as "fixed-size values" is undefined.

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

13 years agostrings: Rename example to match function name.
Volker Dobler [Mon, 5 Mar 2012 11:19:51 +0000 (22:19 +1100)]
strings: Rename example to match function name.

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

13 years agodoc: fix download link on front page
Andrew Gerrand [Mon, 5 Mar 2012 06:07:10 +0000 (17:07 +1100)]
doc: fix download link on front page

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

13 years agotag weekly.2012-03-04
Andrew Gerrand [Mon, 5 Mar 2012 05:09:13 +0000 (16:09 +1100)]
tag weekly.2012-03-04

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

13 years agoweekly.2012-03-04 weekly.2012-03-04
Andrew Gerrand [Mon, 5 Mar 2012 04:45:50 +0000 (15:45 +1100)]
weekly.2012-03-04

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

13 years agodoc: add command docs page, canonicalize reference paths
Andrew Gerrand [Mon, 5 Mar 2012 04:30:27 +0000 (15:30 +1100)]
doc: add command docs page, canonicalize reference paths

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

13 years agodoc: add help page, update project page
Andrew Gerrand [Mon, 5 Mar 2012 04:07:43 +0000 (15:07 +1100)]
doc: add help page, update project page

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

13 years agodoc: clean up docs page, refer to wiki, change install doc paths
Andrew Gerrand [Mon, 5 Mar 2012 03:31:27 +0000 (14:31 +1100)]
doc: clean up docs page, refer to wiki, change install doc paths

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

13 years agocmd: update formatting of usage messages
Andrew Gerrand [Mon, 5 Mar 2012 03:23:00 +0000 (14:23 +1100)]
cmd: update formatting of usage messages

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

13 years agodoc/progs: update for go 1
Rob Pike [Mon, 5 Mar 2012 01:49:31 +0000 (12:49 +1100)]
doc/progs: update for go 1
Fixes #3076.

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

13 years agocmd/go: fix grammar error in help messages
Rob Pike [Mon, 5 Mar 2012 00:52:31 +0000 (11:52 +1100)]
cmd/go: fix grammar error in help messages

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

13 years agodoc/effective_go: minor fix
Shenghou Ma [Mon, 5 Mar 2012 00:12:58 +0000 (11:12 +1100)]
doc/effective_go: minor fix
        We have 'gofmt' and 'go fmt', but not 'go tool fmt'.

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

13 years agohtml/template: fix comment typo
Scott Lawrence [Sun, 4 Mar 2012 23:58:43 +0000 (10:58 +1100)]
html/template: fix comment typo

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

13 years agomisc: update usage message in benchcmp for go tool
Dave Cheney [Sun, 4 Mar 2012 23:57:58 +0000 (10:57 +1100)]
misc: update usage message in benchcmp for go tool

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

13 years agodoc: change menu, tweak front page
Andrew Gerrand [Sun, 4 Mar 2012 23:34:22 +0000 (10:34 +1100)]
doc: change menu, tweak front page

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

13 years agonet: move MAC address parser into distinct file
Mikio Hara [Sun, 4 Mar 2012 22:42:07 +0000 (07:42 +0900)]
net: move MAC address parser into distinct file

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

13 years ago doc: fix another typo in article on defer, panic and recover
Francisco Souza [Sun, 4 Mar 2012 03:40:14 +0000 (14:40 +1100)]
doc: fix another typo in article on defer, panic and recover

Fixes #3177

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

13 years agogodoc: fix codewalks
Andrew Gerrand [Sun, 4 Mar 2012 00:53:07 +0000 (11:53 +1100)]
godoc: fix codewalks

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

13 years agodoc: fixed minor typo in article on defer
Francisco Souza [Sun, 4 Mar 2012 00:34:21 +0000 (11:34 +1100)]
doc: fixed minor typo in article on defer

Fixes #3176.

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

13 years agoA+C: add Francisco Souza
Andrew Gerrand [Sun, 4 Mar 2012 00:34:10 +0000 (11:34 +1100)]
A+C: add Francisco Souza

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

13 years agogodoc: hide "Subdirectories" subheading if it is the only section
Andrew Gerrand [Sat, 3 Mar 2012 22:57:09 +0000 (09:57 +1100)]
godoc: hide "Subdirectories" subheading if it is the only section

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

13 years agotext/template: one more test case
Rob Pike [Sat, 3 Mar 2012 21:06:26 +0000 (08:06 +1100)]
text/template: one more test case
Missed a case for variadic functions with too few arguments.
The code passes, and with the right error, but might as well record the test case.

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

13 years agotext/template: clean up function values
Rob Pike [Sat, 3 Mar 2012 12:14:20 +0000 (23:14 +1100)]
text/template: clean up function values
The recent addition of automatic function invocation generated
some troublesome ambiguities. Restore the previous behavior
and compensate by providing a "call" builtin to make it easy to
do what the automatic invocation did, but in a clear and explicit
manner.

Fixes #3140.

At least for now.

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

13 years agocmd/go: fix relative imports again
Russ Cox [Sat, 3 Mar 2012 03:16:02 +0000 (22:16 -0500)]
cmd/go: fix relative imports again

I tried before to make relative imports work by simply
invoking the compiler in the right directory, so that
an import of ./foo could be resolved by ./foo.a.
This required creating a separate tree of package binaries
that included the full path to the source directory, so that
/home/gopher/bar.go would be compiled in
tmpdir/work/local/home/gopher and perhaps find
a ./foo.a in that directory.

This model breaks on Windows because : appears in path
names but cannot be used in subdirectory names, and I
missed one or two places where it needed to be removed.

The model breaks more fundamentally when compiling
a test of a package that lives outside the Go path, because
we effectively use a ./ import in the generated testmain,
but there we want to be able to resolve the ./ import
of the test package to one directory and all the other ./
imports to a different directory.  Piggybacking on the compiler's
current working directory is then no longer possible.

Instead, introduce a new compiler option -D prefix that
makes the compiler turn a ./ import into prefix+that,
so that import "./foo" with -D a/b/c turns into import
"a/b/c/foo".  Then we can invent a package hierarchy
"_/" with subdirectories named for file system paths:
import "./foo" in the directory /home/gopher becomes
import "_/home/gopher/foo", and since that final path
is just an ordinary import now, all the ordinary processing
works, without special cases.

We will have to change the name of the hierarchy if we
ever decide to introduce a standard package with import
path "_", but that seems unlikely, and the detail is known
only in temporary packages that get thrown away at the
end of a build.

Fixes #3169.

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

13 years agodoc: remove roadmap document
Andrew Gerrand [Sat, 3 Mar 2012 01:53:37 +0000 (12:53 +1100)]
doc: remove roadmap document

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

13 years agodoc: change wording on references page
Andrew Gerrand [Sat, 3 Mar 2012 01:48:35 +0000 (12:48 +1100)]
doc: change wording on references page

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

13 years agomisc: add zsh completion for go tool.
Rémy Oudompheng [Fri, 2 Mar 2012 23:12:40 +0000 (00:12 +0100)]
misc: add zsh completion for go tool.

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

13 years agodoc/install-source.html: update for go tool
Rob Pike [Fri, 2 Mar 2012 22:36:09 +0000 (09:36 +1100)]
doc/install-source.html: update for go tool
Make some updates, get rid of mentions of make.
There remain a number of open questions.

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

13 years agoXcode: move Xcode3 specific files into sub directory
Robert Griesemer [Fri, 2 Mar 2012 22:15:44 +0000 (14:15 -0800)]
Xcode: move Xcode3 specific files into sub directory

- makes space for Xcode4 files
- added README

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

13 years agofix build for FreeBSD/amd64
Shenghou Ma [Fri, 2 Mar 2012 20:47:42 +0000 (04:47 +0800)]
fix build for FreeBSD/amd64

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

13 years agold: allow more -L options
Shenghou Ma [Fri, 2 Mar 2012 20:14:31 +0000 (04:14 +0800)]
ld: allow more -L options
        Dynamically allocate the libdir array, so we won't need to bother it again.
        Enhances CL 5727043.

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

13 years agogo/printer: simpler exprList code, more tests
Robert Griesemer [Fri, 2 Mar 2012 19:16:05 +0000 (11:16 -0800)]
go/printer: simpler exprList code, more tests

Except for the tests, this is mostly deleting code:

- removed several exprListModes:
  blankStart: easily done explicitly, and trailing blanks
    are cleaned up by the trimmer post-pass
  blankEnd: never used
  commaSep: all exprLists calls had this set

- added test cases for multi-line returns
(for a later fix of issue 1207)

- no formatting changes

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

13 years agoall: more typos
Robert Griesemer [Fri, 2 Mar 2012 19:15:45 +0000 (11:15 -0800)]
all: more typos

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

13 years agonet: during short test, don't bother timeout longer than expected
Shenghou Ma [Fri, 2 Mar 2012 16:50:18 +0000 (00:50 +0800)]
net: during short test, don't bother timeout longer than expected

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

13 years agodoc/go1: minor corrections
Shenghou Ma [Fri, 2 Mar 2012 16:47:11 +0000 (00:47 +0800)]
doc/go1: minor corrections
        Set dagger looks very much like t in some fonts, so superscript it.
        os/signal is no longer in exp.

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

13 years agocmd/go: avoid repeated include dirs.
Rémy Oudompheng [Fri, 2 Mar 2012 16:31:13 +0000 (11:31 -0500)]
cmd/go: avoid repeated include dirs.

Fixes #3171.

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

13 years agodoc: fix some HTML errors in code.html
Sanjay Menakuru [Fri, 2 Mar 2012 16:29:09 +0000 (11:29 -0500)]
doc: fix some HTML errors in code.html

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

13 years agocmd/go: fix test import dependency bug
Russ Cox [Fri, 2 Mar 2012 16:27:36 +0000 (11:27 -0500)]
cmd/go: fix test import dependency bug

Fixes a problem Rob is having with goprotobuf.
Cannot add a test because the same case is more broken
when using ./ imports.  That still needs to be fixed,
and is one aspect of issue 3169.

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

13 years agocmd/go: fixes for gccgo.
Rémy Oudompheng [Fri, 2 Mar 2012 07:36:53 +0000 (08:36 +0100)]
cmd/go: fixes for gccgo.

Also remove useless "install" argument to pkgpath now that go/build
defines package install locations.

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

13 years agobuild: add GO_ prefix to LDFLAGS and GCFLAGS
Gustavo Niemeyer [Fri, 2 Mar 2012 05:45:01 +0000 (02:45 -0300)]
build: add GO_ prefix to LDFLAGS and GCFLAGS

Build environments will often define stock LDFLAGS
that are not compatible with the gc ld, causing
non-obvious failures midway through the build.

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

13 years agoos: sleep 5ms after process has exited on windows
Alex Brainman [Fri, 2 Mar 2012 05:35:42 +0000 (16:35 +1100)]
os: sleep 5ms after process has exited on windows

Fixes #2866.

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

13 years agodoc: expand code.html to discuss the go tool in more depth
Andrew Gerrand [Fri, 2 Mar 2012 04:35:36 +0000 (15:35 +1100)]
doc: expand code.html to discuss the go tool in more depth

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

13 years agoos: implement UserTime/SystemTime on windows
Alex Brainman [Fri, 2 Mar 2012 03:47:40 +0000 (14:47 +1100)]
os: implement UserTime/SystemTime on windows

Fixes #3145.

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

13 years agoos: fix grammar in ProcessState comment
Rob Pike [Fri, 2 Mar 2012 03:07:26 +0000 (14:07 +1100)]
os: fix grammar in ProcessState comment
Asymptotic convergence.

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

13 years agoos: centralize documentation of Process and ProcessState
Russ Cox [Fri, 2 Mar 2012 02:56:54 +0000 (21:56 -0500)]
os: centralize documentation of Process and ProcessState

Also change Wait to say "exit" instead of "exit or stop".

I notice that Pid is not implemented on all systems.
Should we fix that?

Fixes #3138.

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

13 years agodoc: update go1 for html changes
Andrew Gerrand [Fri, 2 Mar 2012 00:52:46 +0000 (11:52 +1100)]
doc: update go1 for html changes

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

13 years agogo/build: fix build
Russ Cox [Fri, 2 Mar 2012 00:42:39 +0000 (19:42 -0500)]
go/build: fix build

Presumably something about the very large go/build
doc comment breaks the build constraint parser in
cmd/dist.  I don't feel like debugging C code right now,
so move it into its own file.  If cmd/dist decides doc.go
is not part of the package, it will still build correctly.

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

13 years agogo/build: document GOPATH
Russ Cox [Thu, 1 Mar 2012 23:26:53 +0000 (18:26 -0500)]
go/build: document GOPATH

Fixes #2332.

R=golang-dev, remyoudompheng, gri, r, r
CC=golang-dev
https://golang.org/cl/5710055

13 years agodoc: describe API changes to go/build
Russ Cox [Thu, 1 Mar 2012 23:17:28 +0000 (18:17 -0500)]
doc: describe API changes to go/build

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

13 years agocmd/go: fix verbose command displaying
Gustavo Niemeyer [Thu, 1 Mar 2012 23:14:21 +0000 (20:14 -0300)]
cmd/go: fix verbose command displaying

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

13 years agocmd/go: fix -I flag for gc command
Gustavo Niemeyer [Thu, 1 Mar 2012 23:13:04 +0000 (20:13 -0300)]
cmd/go: fix -I flag for gc command

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

13 years agoall: fixed various typos
Robert Griesemer [Thu, 1 Mar 2012 22:56:05 +0000 (14:56 -0800)]
all: fixed various typos

(Semi-automatically detected.)

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

13 years agoreflect: expand doc for Value.Interface
Russ Cox [Thu, 1 Mar 2012 22:55:47 +0000 (17:55 -0500)]
reflect: expand doc for Value.Interface

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

13 years agospec: clarifications around exports, uniqueness of identifiers
Robert Griesemer [Thu, 1 Mar 2012 21:57:49 +0000 (13:57 -0800)]
spec: clarifications around exports, uniqueness of identifiers

- Define what it means for two identifiers to be unique.

- The current spec is incorrect about exported
identifiers: for instance, it excluded fields
of non-exported types of exported variables
from being exported. It is easier to leave
the detailed specification away and let the
rest of the spec govern access of exported
identifiers.

- The current spec is incorrect about qualified
identifiers: It simply required that an identifier
be exported to be valid in a qualified identifier.
However, qualified identifiers can only access
exported identifiers declared in the package
block of the imported package.

Fixes #1551.

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

13 years agocmd/dist: Unix grammar fix
Russ Cox [Thu, 1 Mar 2012 18:38:05 +0000 (13:38 -0500)]
cmd/dist: Unix grammar fix

Fixes #3165.

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

13 years agospec: minor tweaks
Robert Griesemer [Thu, 1 Mar 2012 18:35:15 +0000 (10:35 -0800)]
spec: minor tweaks

- more idiomatic examples of pointer types
- show use of _ in examples of function types
- remove "legal:" qualification in examples
  for consistency

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

13 years agoencoding/xml: fix xml test tag usage
Gustavo Niemeyer [Thu, 1 Mar 2012 18:20:13 +0000 (15:20 -0300)]
encoding/xml: fix xml test tag usage

No real problem.

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