]> Cypherpunks repositories - gostls13.git/log
gostls13.git
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

13 years agoos/signal: move to exp/signal.
David Symonds [Wed, 1 Feb 2012 22:08:50 +0000 (09:08 +1100)]
os/signal: move to exp/signal.

Fixes #2816.

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

13 years agogo/build: put a space between 'generated by make' and package statement
Andrew Gerrand [Wed, 1 Feb 2012 21:52:22 +0000 (08:52 +1100)]
go/build: put a space between 'generated by make' and package statement

This prevents the message from showing up in godoc.

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

13 years agomat/big: add raw access to Int bits
Robert Griesemer [Wed, 1 Feb 2012 19:43:40 +0000 (11:43 -0800)]
mat/big: add raw access to Int bits

This is a minimal API extension, it makes it possible
to implement missing Int functionality externally w/o
compromising efficiency. It is the hope that this will
reduce the number of feature requests going directly
into the big package.

Also: Fixed some naming inconsistencies: The receiver
is only called z when it is also the result.

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

13 years agocmd/go: fix including of _cgo_export.h
Gustavo Niemeyer [Wed, 1 Feb 2012 18:07:32 +0000 (16:07 -0200)]
cmd/go: fix including of _cgo_export.h

This will add the temporary object directory into the lookup
path so that cgo-exported function declarations may be
included from C files.

This was previously applied by CL 5600043, and apparently
removed by mistake on CL 5598045.

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

13 years agotest: test that x := <-c accepts a general expression
Ian Lance Taylor [Wed, 1 Feb 2012 15:31:00 +0000 (07:31 -0800)]
test: test that x := <-c accepts a general expression

The gccgo compiler used to fail to parse this.

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

13 years agopkg/math: undo manual inlining of IsInf and IsNaN
Luuk van Dijk [Wed, 1 Feb 2012 15:08:31 +0000 (16:08 +0100)]
pkg/math: undo manual inlining of IsInf and IsNaN

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

13 years agogodoc: fix redirect loop for URL "/".
Sameer Ajmani [Wed, 1 Feb 2012 14:43:22 +0000 (09:43 -0500)]
godoc: fix redirect loop for URL "/".

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

13 years agogc, cc: avoid using the wrong library when building the compilers
Anthony Martin [Wed, 1 Feb 2012 12:14:37 +0000 (04:14 -0800)]
gc, cc: avoid using the wrong library when building the compilers

This can happen on Plan 9 if we we're building
with the 32-bit and 64-bit host compilers, one
after the other.

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

13 years agoencoding/base64: ignore new line characters during decode.
David Symonds [Wed, 1 Feb 2012 08:13:38 +0000 (19:13 +1100)]
encoding/base64: ignore new line characters during decode.

Fixes #2541.

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

13 years agonet, syscall: add IPv4 multicast helpers for windows
Mikio Hara [Wed, 1 Feb 2012 05:14:04 +0000 (14:14 +0900)]
net, syscall: add IPv4 multicast helpers for windows

Also re-enable simple IPv4 multicast testing on windows.

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

13 years agogo/build: update syslist.go package comment
Andrew Gerrand [Wed, 1 Feb 2012 04:12:24 +0000 (15:12 +1100)]
go/build: update syslist.go package comment

It's no longer generated by make.

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

13 years agobuild: move the "-c" flag into HOST_CFLAGS
Anthony Martin [Wed, 1 Feb 2012 03:31:30 +0000 (19:31 -0800)]
build: move the "-c" flag into HOST_CFLAGS

On Plan 9 this flag is used to discover
constant expressions in "if" statements.

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

13 years agogc: use octal escapes in mkopnames
Anthony Martin [Wed, 1 Feb 2012 02:15:42 +0000 (18:15 -0800)]
gc: use octal escapes in mkopnames

Plan 9's tr(1) doesn't accept the C-style escapes
for tab and newline characters.  I was going to use
the \xFF hexadecimal escapes but GNU tr(1) doesn't
accept those.  It seems octal is the least common
denominator.

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

13 years agobuild: add include files for Plan 9
Anthony Martin [Wed, 1 Feb 2012 02:14:44 +0000 (18:14 -0800)]
build: add include files for Plan 9

Previously, I had made available a tarball of
the modified system headers that were necessary
to build on Plan 9 but that was only a stopgap.
I think this method is much better since no
files outside of $GOROOT will have to be added
or modified during the build process.

Also, this is just the first step. I'll change
the build to reference these files in another CL
(that also contains a few more Makefile changes).

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

13 years agosyscall: cache environment variables on Plan 9.
Anthony Martin [Wed, 1 Feb 2012 02:14:02 +0000 (18:14 -0800)]
syscall: cache environment variables on Plan 9.

This can drastically reduce the number of system
calls made by programs that repeatedly query the
environment.

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

13 years agolibmach: add stubs for Plan 9
Anthony Martin [Wed, 1 Feb 2012 02:13:17 +0000 (18:13 -0800)]
libmach: add stubs for Plan 9

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

13 years agonet: fix windows build
Alex Brainman [Wed, 1 Feb 2012 01:13:46 +0000 (12:13 +1100)]
net: fix windows build

Ignore result of setting SO_BROADCAST.

Disable TestSimpleListenMulticastUDP as
setIPv4MulticastInterface is not implemented.

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

13 years agotest: add test which crashed gccgo compiler
Ian Lance Taylor [Wed, 1 Feb 2012 00:19:25 +0000 (16:19 -0800)]
test: add test which crashed gccgo compiler

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

13 years agocmd/go: improvements
Russ Cox [Tue, 31 Jan 2012 23:44:20 +0000 (18:44 -0500)]
cmd/go: improvements

Print all the syntax errors.  Fixes issue 2811.

Change Windows binary removal strategy.
This should keep the temporary files closer to
the binaries they are for, which will make it
more likely that the rename is not cross-device
and also make it easier to clean them up.
Fixes #2604 (as much as we can).

The standard build does not use the go command
to install the go command anymore, so issue 2604
is less of a concern than it originally was.
(It uses the go_bootstrap command to install
the go command.)

Buffer 'go list' output.

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

13 years agogo/doc: added error, rune to list of predeclared types
Robert Griesemer [Tue, 31 Jan 2012 23:41:25 +0000 (15:41 -0800)]
go/doc: added error, rune to list of predeclared types

Don't throw away factory functions returning error or rune.

Fixes #2820.

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

13 years agofmt: fix caching bug in Scan
Russ Cox [Tue, 31 Jan 2012 23:38:33 +0000 (18:38 -0500)]
fmt: fix caching bug in Scan

Black box test is too time-consuming, as the bug
does not appear until Scan has processed 2 GB of
input in total across multiple calls, so no test.

Thanks to Frederick Mayle for the diagnosis and fix.

Fixes #2809.

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

13 years agonet: remove types InvalidConnError and UnknownSocketError
Brad Fitzpatrick [Tue, 31 Jan 2012 23:04:42 +0000 (15:04 -0800)]
net: remove types InvalidConnError and UnknownSocketError

Both are unused and undocumented.

InvalidConnError is also non-idiomatic: a FooError type can
typically describe something, else it would be an ErrFoo
variable.

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

13 years agocmd/go: improvements
Russ Cox [Tue, 31 Jan 2012 22:40:36 +0000 (17:40 -0500)]
cmd/go: improvements

Do not treat $GOROOT/src/pkg, $GOROOT/src/cmd,
$GOPATH/src as package directories (only subdirectories
of those can be package directories).  Fixes issue 2602.

Accept additional compiler and linker arguments during
cgo from $CGO_CFLAGS and $CGO_LDFLAGS, as the
Makefiles used to do.

Show failed pkg-config output.  Fixes issue 2785.

Use different (perhaps better) git commands.  Fixes issue 2109.

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

13 years agogo: record location of failed imports for error reporting.
Rémy Oudompheng [Tue, 31 Jan 2012 22:37:01 +0000 (23:37 +0100)]
go: record location of failed imports for error reporting.

Fixes #2664.

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

13 years agogc: diagnose \ in import path
Russ Cox [Tue, 31 Jan 2012 22:29:59 +0000 (17:29 -0500)]
gc: diagnose \ in import path

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

13 years agobuild: remove ./ from buildscripts
Russ Cox [Tue, 31 Jan 2012 21:53:43 +0000 (16:53 -0500)]
build: remove ./ from buildscripts

Fixes #2753.

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

13 years agonet: move DNSConfigError to a portable file
Brad Fitzpatrick [Tue, 31 Jan 2012 21:01:34 +0000 (13:01 -0800)]
net: move DNSConfigError to a portable file

The type being unavailable on Windows was the only API
signature difference in the net package.

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

13 years agocmd/go: improvements
Russ Cox [Tue, 31 Jan 2012 20:08:20 +0000 (15:08 -0500)]
cmd/go: improvements

Print build errors to stderr during 'go run'.
Stream test output during 'go test' (no args).  Fixes issue 2731.
Add go test -i to install test dependencies.  Fixes issue 2685.
Fix data race in exitStatus.  Fixes issue 2709.
Fix tool paths.  Fixes issue 2817.

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

13 years agocmd/go: fix handling of gccgo standard library.
Rémy Oudompheng [Tue, 31 Jan 2012 18:41:38 +0000 (19:41 +0100)]
cmd/go: fix handling of gccgo standard library.

The previous logic was mainly non-working. It only needs to
ensure that the go tool doesn't try to build the standard
library with gccgo.

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

13 years agogo/doc: enable AllMethods flag (and fix logic)
Robert Griesemer [Tue, 31 Jan 2012 17:48:10 +0000 (09:48 -0800)]
go/doc: enable AllMethods flag (and fix logic)

- enable AllMethods flag (default: not set)
- fix logic determining which methods to show
- added respective test case in testdata/e.go for AllMethods = false
- added test case set for AllMethods = true

The critical changes/files to look at are:
- testdata/e{0,1,2}.golden: T4.M should only show up as method of T5 in e2.golden
- reader.go: always include top-level methods, and negate former logic for embedded methods
  (rewrote as a switch for better comprehensability)

Fixes #2791.

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

13 years agonet/http: close client fd sooner on response read error
Brad Fitzpatrick [Tue, 31 Jan 2012 17:45:13 +0000 (09:45 -0800)]
net/http: close client fd sooner on response read error

This fixes some test noise in TestStressSurpriseServerCloses when
ulimit -n something low, like 256 on a Mac.

Previously, when the server closed on us and we were expecting more
responses (like we are in that test), we'd read an "Unexpected EOF"
and just forget about the client's net.Conn.  Now it's closed,
rather than waiting on the finalizer to release the fd.

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

13 years agonet: disable normal multicast testing on linux/arm
Mikio Hara [Tue, 31 Jan 2012 17:42:56 +0000 (02:42 +0900)]
net: disable normal multicast testing on linux/arm

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

13 years agocrypto/elliptic: p224Contract could produce a non-minimal representation.
Adam Langley [Tue, 31 Jan 2012 17:27:42 +0000 (12:27 -0500)]
crypto/elliptic: p224Contract could produce a non-minimal representation.

I missed an overflow in contract because I suspected that the prime
elimination would take care of it. It didn't, and I forgot to get back
to the overflow. Because of this, p224Contract may have produced a
non-minimal representation, causing flakey failures ~0.02% of the
time.

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

13 years agonet: ListenMulticastUDP to listen concurrently across multiple listeners
Mikio Hara [Tue, 31 Jan 2012 16:53:26 +0000 (01:53 +0900)]
net: ListenMulticastUDP to listen concurrently across multiple listeners

This CL introduces new function ListenMulticastUDP to fix
multicast UDP listening across multiple listeners issue,
to replace old multicast methods JoinGroup and LeaveGroup
on UDPConn.

This CL also enables multicast testing by default.

Fixes #2730.

R=rsc, paul.a.lalonde, fullung, devon.odell
CC=golang-dev
https://golang.org/cl/5562048

13 years agocrypto/tls: better error message when connecting to SSLv3 servers.
Adam Langley [Tue, 31 Jan 2012 16:22:47 +0000 (11:22 -0500)]
crypto/tls: better error message when connecting to SSLv3 servers.

We support SSLv3 as a server but not as a client (and we don't want to
support it as a client). This change fixes the error message when
connecting to an SSLv3 server since SSLv3 support on the server side
made mutualVersion accept SSLv3.

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

13 years agonet: fix windows build
Russ Cox [Tue, 31 Jan 2012 16:20:34 +0000 (11:20 -0500)]
net: fix windows build

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

13 years agocrypto/x509: use case-insensitive hostname matching.
Adam Langley [Tue, 31 Jan 2012 16:00:16 +0000 (11:00 -0500)]
crypto/x509: use case-insensitive hostname matching.

Fixes #2792.

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