]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agocmd/gc: another special (%hhS) case for method names.
Luuk van Dijk [Mon, 6 Feb 2012 15:38:59 +0000 (16:38 +0100)]
cmd/gc: another special (%hhS) case for method names.

Fixes #2877

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

13 years agocmd/gc: fix codegen reordering for expressions involving && and ||
Luuk van Dijk [Mon, 6 Feb 2012 14:41:01 +0000 (15:41 +0100)]
cmd/gc: fix codegen reordering for expressions involving && and ||

Fixes #2821.

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

13 years agoarchive/zip: support full range of FileMode flags
Gustavo Niemeyer [Mon, 6 Feb 2012 13:58:32 +0000 (11:58 -0200)]
archive/zip: support full range of FileMode flags

Zip files may actually store symlinks, and that's represented
as a file with unix flag S_IFLNK and with its data containing
the symlink target name.

The other flags are being supported too. Now that the os package
has the full range of flags in a system agnostic manner, there's
no reason to discard that information.

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

13 years agogc: don't print implicit type on struct literal in export
Luuk van Dijk [Mon, 6 Feb 2012 11:19:59 +0000 (12:19 +0100)]
gc: don't print implicit type on struct literal in export

As pointed out in the discussion around 2678.

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

13 years agonet/http: Don't set Content-Type header for HEAD requests by default
Patrick Mylund Nielsen [Mon, 6 Feb 2012 06:55:47 +0000 (17:55 +1100)]
net/http: Don't set Content-Type header for HEAD requests by default
since the real type is not inferred.
Fixes #2885.

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

13 years agoA+C: Patrick Mylund Nielsen (individual CLA)
David Symonds [Mon, 6 Feb 2012 06:54:56 +0000 (17:54 +1100)]
A+C: Patrick Mylund Nielsen (individual CLA)

R=golang-dev
TBR=adg
CC=golang-dev, patrick
https://golang.org/cl/5616070

13 years agobytes: API tweaks
Rob Pike [Mon, 6 Feb 2012 04:29:21 +0000 (15:29 +1100)]
bytes: API tweaks
- fix documentation for NewBuffer and NewBufferString
- document and implement behavior of Truncate on invalid lengths

Fixes #2837.

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

13 years agoio: API tweaks
Rob Pike [Mon, 6 Feb 2012 04:09:50 +0000 (15:09 +1100)]
io: API tweaks
- eliminate local Error type (a historical artifact)
- fix documentation of CopyN
- fix documentation of WriteString
Fixes #2859.

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

13 years ago cmd/go: build: print import errors when invoked on files
Kyle Lemons [Mon, 6 Feb 2012 03:10:03 +0000 (14:10 +1100)]
        cmd/go: build: print import errors when invoked on files

      This fix makes the goFilesPackage helper function print the errors from
      package imports and exit similar to how the packagesForBuild function does.

      Without this change, when invoking "go build *.go" with, for example,
      an old import path, the following stack trace is generated:

      panic: runtime error: invalid memory address or nil pointer dereference

      goroutine 1 [running]:
      go/build.(*Tree).PkgDir(...)
              /opt/go/src/pkg/go/build/path.go:52 +0xfb
      main.(*builder).action(...)
              /opt/go/src/cmd/go/build.go:327 +0xb8
      main.(*builder).action(...)
              /opt/go/src/cmd/go/build.go:335 +0x208
      main.runBuild(...)
              /opt/go/src/cmd/go/build.go:129 +0x386
      main.main()
              /opt/go/src/cmd/go/main.go:126 +0x2d8

Fixes #2865.

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

13 years agoall: avoid bytes.NewBuffer(nil)
Rob Pike [Mon, 6 Feb 2012 03:09:00 +0000 (14:09 +1100)]
all: avoid bytes.NewBuffer(nil)
The practice encourages people to think this is the way to
create a bytes.Buffer when new(bytes.Buffer) or
just var buf bytes.Buffer work fine.
(html/token.go was missing the point altogether.)

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

13 years agogob: fuzz testing, plus a fix for very large type names.
David Symonds [Mon, 6 Feb 2012 03:02:12 +0000 (14:02 +1100)]
gob: fuzz testing, plus a fix for very large type names.

Fixes #2689.

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

13 years agotesting: capture panics, present them, and mark the test as a failure.
David Symonds [Mon, 6 Feb 2012 03:00:23 +0000 (14:00 +1100)]
testing: capture panics, present them, and mark the test as a failure.

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

13 years agohtml: add package doc.
Nigel Tao [Mon, 6 Feb 2012 02:24:45 +0000 (13:24 +1100)]
html: add package doc.

Fixes #2857.

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

13 years agonet: fix Plan 9 build
Anthony Martin [Mon, 6 Feb 2012 00:59:32 +0000 (16:59 -0800)]
net: fix Plan 9 build

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

13 years ago.hgignore: delete more dregs
Rob Pike [Mon, 6 Feb 2012 00:25:28 +0000 (11:25 +1100)]
.hgignore: delete more dregs

R=golang-dev, ality
CC=golang-dev
https://golang.org/cl/5636044

13 years ago.hgignore: delete dregs
Rob Pike [Mon, 6 Feb 2012 00:09:38 +0000 (11:09 +1100)]
.hgignore: delete dregs

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

13 years agoimage: add package docs, rename s/UnknownFormatError/ErrFormat/ and
Nigel Tao [Mon, 6 Feb 2012 00:04:12 +0000 (11:04 +1100)]
image: add package docs, rename s/UnknownFormatError/ErrFormat/ and
rewrite the doc comment for Repeated.

Fixes #2858.

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

13 years agodashboard: update to go1beta
Andrew Gerrand [Sun, 5 Feb 2012 22:26:32 +0000 (09:26 +1100)]
dashboard: update to go1beta

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

13 years agocmd/dist: fix bug in bsubst
Alex Brainman [Sun, 5 Feb 2012 04:16:39 +0000 (15:16 +1100)]
cmd/dist: fix bug in bsubst

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

13 years agobuild: fix sudo.bash.
David Symonds [Sun, 5 Feb 2012 03:50:38 +0000 (14:50 +1100)]
build: fix sudo.bash.

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

13 years ago.hgignore: add VERSION.cache
Gustavo Niemeyer [Sun, 5 Feb 2012 02:36:20 +0000 (00:36 -0200)]
.hgignore: add VERSION.cache

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

13 years agocmd/dist: add GOBIN to env's output
Gustavo Niemeyer [Sun, 5 Feb 2012 02:35:08 +0000 (00:35 -0200)]
cmd/dist: add GOBIN to env's output

clean.bash depends on it being set.

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

13 years agodoc/go1.html: style tweak for expvar notes.
David Symonds [Sat, 4 Feb 2012 10:55:38 +0000 (21:55 +1100)]
doc/go1.html: style tweak for expvar notes.

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

13 years agounicode: document large var blocks and the SpecialCase vars.
David Symonds [Sat, 4 Feb 2012 07:35:37 +0000 (18:35 +1100)]
unicode: document large var blocks and the SpecialCase vars.

Fixes #2772.

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

13 years agocmd/dist: fix memory bug (fix builders?)
Russ Cox [Sat, 4 Feb 2012 07:15:53 +0000 (02:15 -0500)]
cmd/dist: fix memory bug (fix builders?)

Thanks, Valgrind!

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

13 years agocmd/dist: fix arm build
Russ Cox [Sat, 4 Feb 2012 07:01:58 +0000 (02:01 -0500)]
cmd/dist: fix arm build

5l does not use the whole set of ld files
like the other linkers do.

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

13 years agocmd/dist: more build fixes
Russ Cox [Sat, 4 Feb 2012 06:46:46 +0000 (01:46 -0500)]
cmd/dist: more build fixes

Flush stdout before writing to stderr, to avoid
reordering output.

Allow amd64 from uname -m (FreeBSD).

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

13 years agocmd/dist: add BSD gohostos cases
Russ Cox [Sat, 4 Feb 2012 06:39:29 +0000 (01:39 -0500)]
cmd/dist: add BSD gohostos cases

Should fix FreeBSD build.

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

13 years agopath/filepath: disable broken tests
Russ Cox [Sat, 4 Feb 2012 06:37:30 +0000 (01:37 -0500)]
path/filepath: disable broken tests

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

13 years agocmd/dist: fix build
Russ Cox [Sat, 4 Feb 2012 06:23:54 +0000 (01:23 -0500)]
cmd/dist: fix build

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

13 years agobuild: delete buildscripts, runtime scripts
Russ Cox [Sat, 4 Feb 2012 05:54:26 +0000 (00:54 -0500)]
build: delete buildscripts, runtime scripts

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

13 years agobuild: use cmd/dist
Russ Cox [Sat, 4 Feb 2012 05:54:08 +0000 (00:54 -0500)]
build: use cmd/dist

R=bradfitz, ality, r, r, iant, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5615058

13 years agobuild: dist-based build for windows
Russ Cox [Sat, 4 Feb 2012 05:48:31 +0000 (00:48 -0500)]
build: dist-based build for windows

R=golang-dev, bradfitz, iant, alex.brainman, go.peter.90
CC=golang-dev
https://golang.org/cl/5630047

13 years agocmd/dist: fix build on openbsd
Mikio Hara [Sat, 4 Feb 2012 04:27:12 +0000 (13:27 +0900)]
cmd/dist: fix build on openbsd

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

13 years agoexpvar: revise API.
David Symonds [Sat, 4 Feb 2012 03:32:05 +0000 (14:32 +1100)]
expvar: revise API.

Nuke RemoveAll from the public API.
Replace Iter functions with Do functions.

Fixes #2852.

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

13 years agotest: fix copyright year in new test case
Ian Lance Taylor [Sat, 4 Feb 2012 01:36:48 +0000 (17:36 -0800)]
test: fix copyright year in new test case

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

13 years agoreflect: test that PtrTo returns types that match program types
Ian Lance Taylor [Sat, 4 Feb 2012 01:36:25 +0000 (17:36 -0800)]
reflect: test that PtrTo returns types that match program types

The gccgo compiler was failing this test.

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

13 years agogo/printer: update documentation
Robert Griesemer [Sat, 4 Feb 2012 00:57:59 +0000 (16:57 -0800)]
go/printer: update documentation

Fixes #2855.

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

13 years agotest: test method expressions with parameters, and with import
Ian Lance Taylor [Sat, 4 Feb 2012 00:38:59 +0000 (16:38 -0800)]
test: test method expressions with parameters, and with import

The gccgo compiler had two different bugs triggered by this
test case.

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

13 years agospec: correct primes
Christopher Wedgwood [Fri, 3 Feb 2012 23:34:31 +0000 (10:34 +1100)]
spec: correct primes

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

13 years agocmd/dist: generate files for package runtime
Russ Cox [Fri, 3 Feb 2012 23:16:42 +0000 (18:16 -0500)]
cmd/dist: generate files for package runtime
goc2c moves here.
parallel builds like old makefiles (-j4).
add clean command.
add banner command.
implement Go version check.
real argument parsing (same as 6g etc)

Windows changes will be a separate CL.

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

13 years agodocs: replace references to gofix etc. with tool invocations
Rob Pike [Fri, 3 Feb 2012 20:49:51 +0000 (07:49 +1100)]
docs: replace references to gofix etc. with tool invocations

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

13 years agotest: fix bug headers
Russ Cox [Fri, 3 Feb 2012 20:22:19 +0000 (15:22 -0500)]
test: fix bug headers

The letter is $A, not $O.
($O is set accidentally, but not for long.)

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

13 years agolib9/utf: make safe for automatic build
Russ Cox [Fri, 3 Feb 2012 20:19:00 +0000 (15:19 -0500)]
lib9/utf: make safe for automatic build

Add // +build ignore to mkrunetype.c,
rename runetypebody to be .h since it is #included,
delete old runetypebody tables.

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

13 years agocrypto/...: changes to address some of bug 2841.
Adam Langley [Fri, 3 Feb 2012 20:08:53 +0000 (15:08 -0500)]
crypto/...: changes to address some of bug 2841.

This change addresses a subset of the issues raised in bug 2841.

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

13 years agotools: update references to "x" to be "go tool x"
Rob Pike [Fri, 3 Feb 2012 20:03:20 +0000 (07:03 +1100)]
tools: update references to "x" to be "go tool x"
For instance, don't talk about gofix, talk about the
fix tool or "go tool fix".

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

13 years agotest: don't use package main for files without a main function
Brad Fitzpatrick [Fri, 3 Feb 2012 19:43:24 +0000 (11:43 -0800)]
test: don't use package main for files without a main function

Part of issue 2833, but works fine with current test runner.

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

13 years agostrings: add Fields example
Brad Fitzpatrick [Fri, 3 Feb 2012 19:17:55 +0000 (11:17 -0800)]
strings: add Fields example

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

13 years agospec: restore primality
Rob Pike [Fri, 3 Feb 2012 19:16:02 +0000 (06:16 +1100)]
spec: restore primality
9 is prime if it's a hot day.

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

13 years agogodoc: provide link to subdirectories, if any
Robert Griesemer [Fri, 3 Feb 2012 18:17:37 +0000 (10:17 -0800)]
godoc: provide link to subdirectories, if any

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

13 years agomath/big: more accurate package comment
Robert Griesemer [Fri, 3 Feb 2012 18:17:19 +0000 (10:17 -0800)]
math/big: more accurate package comment

Fix some receiver names for consistency.

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

13 years agogodoc: fix identifier search
Robert Griesemer [Fri, 3 Feb 2012 17:20:53 +0000 (09:20 -0800)]
godoc: fix identifier search

Thanks to Andrey Mirtchovski for tracking this down.

This was broken by CL 5528077 which removed the InsertSemis
flag from go/scanner - as a result, semicolons are now always
inserted and the respective indexer code checked for the
wrong token.

Replaced the code by a direct identifier test.

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

13 years agogodoc: diagnostic for empty FS tree
Robert Griesemer [Fri, 3 Feb 2012 16:33:29 +0000 (08:33 -0800)]
godoc: diagnostic for empty FS tree

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

13 years agocodereview: allow spaces in y.tab.[ch]
Russ Cox [Fri, 3 Feb 2012 15:54:05 +0000 (10:54 -0500)]
codereview: allow spaces in y.tab.[ch]

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

13 years ago5a, 6a, 8a, cc: check in y.tab.[ch]
Russ Cox [Fri, 3 Feb 2012 15:53:51 +0000 (10:53 -0500)]
5a, 6a, 8a, cc: check in y.tab.[ch]

This enables builds on systems without Bison/yacc.

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

13 years agogc: check in y.tab.[ch], yerr.h, builtin.c.
Russ Cox [Fri, 3 Feb 2012 15:53:31 +0000 (10:53 -0500)]
gc: check in y.tab.[ch], yerr.h, builtin.c.

This enables builds on systems without Bison/yacc.

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

13 years agospec: 9 only looks prime
Russ Cox [Fri, 3 Feb 2012 15:30:52 +0000 (10:30 -0500)]
spec: 9 only looks prime

Fixes #2870.

R=golang-dev, agl, lvd
CC=golang-dev
https://golang.org/cl/5618050

13 years agotest: add test for receiver named _
Ian Lance Taylor [Fri, 3 Feb 2012 15:19:25 +0000 (07:19 -0800)]
test: add test for receiver named _

Was miscompiled by gccgo.

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

13 years agotest: test slice beyond len
Ian Lance Taylor [Fri, 3 Feb 2012 14:29:30 +0000 (06:29 -0800)]
test: test slice beyond len

When slicing a slice, the bounds may be > len as long as they
are <= cap.  Interestingly, gccgo got that wrong and still
passed the testsuite and all the library tests.

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

13 years agobuild: crash if test runs forever
Alex Brainman [Fri, 3 Feb 2012 05:45:51 +0000 (16:45 +1100)]
build: crash if test runs forever

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

13 years agocmd/go: add support for release tags via git branches
Gustavo Niemeyer [Fri, 3 Feb 2012 05:03:13 +0000 (03:03 -0200)]
cmd/go: add support for release tags via git branches

R=rsc, remyoudompheng, gustavo, dsymonds
CC=golang-dev
https://golang.org/cl/5617057

13 years agobuild: rename $GOROOT/bin/go-tool to $GOROOT/bin/tool.
Russ Cox [Fri, 3 Feb 2012 04:32:41 +0000 (23:32 -0500)]
build: rename $GOROOT/bin/go-tool to $GOROOT/bin/tool.

The go- is redundant now that the directory is required
to be inside $GOROOT.  Rob LGTMed the idea.

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

13 years agovet: add a check for untagged struct literals.
Nigel Tao [Fri, 3 Feb 2012 03:33:41 +0000 (14:33 +1100)]
vet: add a check for untagged struct literals.

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

13 years agogo/doc: don't lose factory functions of non-exported types
Robert Griesemer [Fri, 3 Feb 2012 03:25:29 +0000 (19:25 -0800)]
go/doc: don't lose factory functions of non-exported types

Fixes #2824.

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

13 years agosyscall: update bootstrap scripts to sync with new go command
Mikio Hara [Fri, 3 Feb 2012 03:22:40 +0000 (12:22 +0900)]
syscall: update bootstrap scripts to sync with new go command

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

13 years agomath/big: API, documentation cleanup
Robert Griesemer [Fri, 3 Feb 2012 03:21:55 +0000 (19:21 -0800)]
math/big: API, documentation cleanup

Fixes #2863.

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

13 years agodashboard: don't send failing Go commits as todos for subrepos
Andrew Gerrand [Fri, 3 Feb 2012 03:03:46 +0000 (14:03 +1100)]
dashboard: don't send failing Go commits as todos for subrepos

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

13 years agoencoding/base32: ignore new line characters during decode.
David Symonds [Fri, 3 Feb 2012 02:36:38 +0000 (13:36 +1100)]
encoding/base32: ignore new line characters during decode.

This is the analogue to the encoding/base64 change,
https://golang.org/cl/5610045.

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

13 years ago.hgignore: update to ignore tmpltohtml.
David Symonds [Fri, 3 Feb 2012 02:25:26 +0000 (13:25 +1100)]
.hgignore: update to ignore tmpltohtml.

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

13 years agoos: turn FileStat.Sys into a method on FileInfo
Gustavo Niemeyer [Fri, 3 Feb 2012 02:16:18 +0000 (00:16 -0200)]
os: turn FileStat.Sys into a method on FileInfo

This reduces the overhead necessary to work with OS-specific
file details, hides the implementation of FileStat, and
preserves the implementation-specific nature of Sys.

Expressions such as:

  stat.(*os.FileInfo).Sys.(*syscall.Stat_t).Uid
  fi1.(*os.FileStat).SameFile(fi2.(*os.FileStat))

Are now spelled as::

  stat.Sys().(*syscall.Stat_t).Uid
  os.SameFile(fi1, fi2)

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

13 years agogo/doc: Fix URL linking in ToHTML.
Gary Burd [Fri, 3 Feb 2012 01:02:05 +0000 (17:02 -0800)]
go/doc: Fix URL linking in ToHTML.

Fixes issue: 2832

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

13 years agoencoding/base32: add DecodeString and EncodeToString helper methods.
David Symonds [Fri, 3 Feb 2012 00:52:04 +0000 (11:52 +1100)]
encoding/base32: add DecodeString and EncodeToString helper methods.

This makes encoding/base32 be consistent with encoding/base64.

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

13 years agogo/scanner: idiomatic receiver names
Robert Griesemer [Fri, 3 Feb 2012 00:42:29 +0000 (16:42 -0800)]
go/scanner: idiomatic receiver names

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

13 years agosyscall: fix // +build comments in types_*.go
Russ Cox [Fri, 3 Feb 2012 00:42:02 +0000 (19:42 -0500)]
syscall: fix // +build comments in types_*.go

I fixed types_linux.go yesterday but missed the others.

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

13 years agocmd/dist: new command
Russ Cox [Fri, 3 Feb 2012 00:41:39 +0000 (19:41 -0500)]
cmd/dist: new command

dist is short for distribution.  This is the new Go distribution tool.

The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.

It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.

This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap).  I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.

This tool is not nearly as nice as the go tool.  There are many
special cases that turn into simple if statements or tables in
the code.  Please forgive that.  C does not enjoy the benefits
that we designed into Go.

I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments.  Make thinks it is invoking

        quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c

but bash (quietgcc is a bash script) thinks it is being invoked as

        quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c

which obviously does not have the desired effect.  Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.

It is big for a single CL, and for that I apologize.  I can cut it into
separate CLs along file boundaries if people would prefer that.

R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045

13 years agoencoding/json: call (*T).MarshalJSON for addressable T values.
David Symonds [Fri, 3 Feb 2012 00:15:06 +0000 (11:15 +1100)]
encoding/json: call (*T).MarshalJSON for addressable T values.

Fixes #2170.

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

13 years agostd: add struct field tags to untagged literals.
Nigel Tao [Thu, 2 Feb 2012 23:12:25 +0000 (10:12 +1100)]
std: add struct field tags to untagged literals.

R=rsc, dsymonds, bsiegert, rogpeppe
CC=golang-dev
https://golang.org/cl/5619052

13 years agocmd/go: fix error message on non-existing tools.
Rémy Oudompheng [Thu, 2 Feb 2012 22:52:30 +0000 (23:52 +0100)]
cmd/go: fix error message on non-existing tools.

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

13 years agomath/big: document Word type
Robert Griesemer [Thu, 2 Feb 2012 22:43:55 +0000 (14:43 -0800)]
math/big: document Word type

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

13 years agonet: tweak variable declarations
Mikio Hara [Thu, 2 Feb 2012 22:40:03 +0000 (07:40 +0900)]
net: tweak variable declarations

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

13 years agogc: describe debugging flags
Anthony Martin [Thu, 2 Feb 2012 22:02:54 +0000 (14:02 -0800)]
gc: describe debugging flags

The change to -m is the only one necessary
to close the issue.  The others are useful
to know about when debugging but shouldn't
be in the usage message since they may go
away or change at any time.

Fixes #2802.

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

13 years agocodereview: explain how to get hgpatch in error message
Brad Fitzpatrick [Thu, 2 Feb 2012 19:53:28 +0000 (11:53 -0800)]
codereview: explain how to get hgpatch in error message

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

13 years agotest: make map nan timing test more robust
Brad Fitzpatrick [Thu, 2 Feb 2012 19:49:28 +0000 (11:49 -0800)]
test: make map nan timing test more robust

take 2

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

13 years agocodereview: don't check default paths when codereview disabled
Andrew Gerrand [Thu, 2 Feb 2012 19:25:13 +0000 (14:25 -0500)]
codereview: don't check default paths when codereview disabled

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

13 years agoruntime: add runtime.cputicks() and seed fastrand with it
Damian Gryski [Thu, 2 Feb 2012 19:09:27 +0000 (14:09 -0500)]
runtime: add runtime.cputicks() and seed fastrand with it

This patch adds a function to get the current cpu ticks.  This is
deemed to be 'sufficiently random' to use to seed fastrand to mitigate
the algorithmic complexity attacks on the hash table implementation.

On AMD64 we use the RDTSC instruction.  For 386, this instruction,
while valid, is not recognized by 8a so I've inserted the opcode by
hand.  For ARM, this routine is currently stubbed to return a constant
0 value.

Future work: update 8a to recognize RDTSC.

Fixes #2630.

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

13 years agoos: Process.handle use syscall.Handle
Wei Guangjing [Thu, 2 Feb 2012 19:08:48 +0000 (14:08 -0500)]
os: Process.handle use syscall.Handle

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

13 years agotest: add import test that caused an incorrect gccgo error
Ian Lance Taylor [Thu, 2 Feb 2012 19:04:09 +0000 (11:04 -0800)]
test: add import test that caused an incorrect gccgo error

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

13 years agoexp/norm: a few minor changes in prepration for a table format change:
Marcel van Lohuizen [Thu, 2 Feb 2012 12:55:53 +0000 (13:55 +0100)]
exp/norm: a few minor changes in prepration for a table format change:
 - Unified bounary conditions for NFC and NFD and removed some indirections.
   This enforces boundaries at the character level, which is typically what
   the user expects. (NFD allows a boundary between 'a' and '`', for example,
   which may give unexpected results for collation.  The current implementation
   is already stricter than the standard, so nothing much changes.  This change
   just formalizes it.
 - Moved methods of qcflags to runeInfo.
 - Swapped YesC and YesMaybe bits in qcFlags. This is to aid future changes.
 - runeInfo return values use named fields in preperation for struct change.
 - Replaced some left-over uint32s with rune.

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

13 years agoexp/norm: Added some benchmarks for form-specific performance measurements.
Marcel van Lohuizen [Thu, 2 Feb 2012 12:19:12 +0000 (13:19 +0100)]
exp/norm: Added some benchmarks for form-specific performance measurements.

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

13 years agovet: fix comment typo.
Nigel Tao [Thu, 2 Feb 2012 06:53:28 +0000 (17:53 +1100)]
vet: fix comment typo.

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

13 years agogophertool: fix link to the build status dashboard
Jongmin Kim [Thu, 2 Feb 2012 04:53:31 +0000 (20:53 -0800)]
gophertool: fix link to the build status dashboard

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

13 years agogodoc: update metadata in appinit.go
Andrew Gerrand [Thu, 2 Feb 2012 04:18:33 +0000 (15:18 +1100)]
godoc: update metadata in appinit.go

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

13 years agoos/exec: make sure file is not closed early in leaked fd test
Ian Lance Taylor [Thu, 2 Feb 2012 00:37:02 +0000 (16:37 -0800)]
os/exec: make sure file is not closed early in leaked fd test

Without this change, fd3 can be collected by the garbage
collector and finalized, which causes the file descriptor to
be closed, which causes the call to os.Open to return 3 rather
than the expected descriptor number.

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

13 years agoall packages: fix various typos
Robert Griesemer [Thu, 2 Feb 2012 00:19:36 +0000 (16:19 -0800)]
all packages: fix various typos

Detected semi-automatically. There are probably more.

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

13 years agosyscall: fix build directive in types_linux.go
Russ Cox [Wed, 1 Feb 2012 23:25:51 +0000 (18:25 -0500)]
syscall: fix build directive in types_linux.go

The rule is that build directives can be preceded only
by blank lines and other line comments, not /* */ comments.

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

13 years agolib9: make safe for automatic builds
Russ Cox [Wed, 1 Feb 2012 23:25:40 +0000 (18:25 -0500)]
lib9: make safe for automatic builds

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

13 years agotest: test append with two different named types with same element type
Ian Lance Taylor [Wed, 1 Feb 2012 23:24:15 +0000 (15:24 -0800)]
test: test append with two different named types with same element type

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

13 years agoos: file windows use syscall.InvalidHandle instead of -1.
Wei Guangjing [Wed, 1 Feb 2012 23:17:52 +0000 (10:17 +1100)]
os: file windows use syscall.InvalidHandle instead of -1.

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

13 years agonet/http/httputil: fix race in DumpRequestOut
Brad Fitzpatrick [Wed, 1 Feb 2012 23:10:14 +0000 (15:10 -0800)]
net/http/httputil: fix race in DumpRequestOut

Fixes #2715

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

13 years agogo/printer: remove package comment from testdata/parser.go
Andrew Gerrand [Wed, 1 Feb 2012 22:28:11 +0000 (09:28 +1100)]
go/printer: remove package comment from testdata/parser.go

This prevents an incorrect summary line from appearing in the godoc
package list.

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