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

9346 Commits

Author SHA1 Message Date
Rob Pike
98c1baff6f 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
2012-03-06 14:58:08 +11:00
Russ Cox
866317af5e 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
2012-03-05 22:47:35 -05:00
Russ Cox
5e41fe0e45 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
2012-03-05 22:47:23 -05:00
Russ Cox
4e110af169 runtime: add Compiler
R=iant, r, gri
CC=golang-dev
https://golang.org/cl/5720073
2012-03-05 22:28:02 -05:00
Russ Cox
0a6fdcf63b net: silence another epoll print
R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/5752048
2012-03-05 22:07:22 -05:00
Mikio Hara
195ccd5dac net: fix windows build
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5755045
2012-03-06 10:07:08 +09:00
Mikio Hara
d4e1383285 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
2012-03-06 09:43:45 +09:00
Rob Pike
d9832987ba 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
2012-03-06 11:14:45 +11:00
Ian Lance Taylor
46031400d0 reflect: fix comment spacing
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5757043
2012-03-05 15:51:58 -08:00
David Symonds
63e383cff8 expvar: add locking to String, and use RWMutex properly throughout.
R=bradfitz
CC=golang-dev
https://golang.org/cl/5754043
2012-03-06 09:13:26 +11:00
Rémy Oudompheng
aa1aaee7fd runtime: wait for main goroutine before setting GOMAXPROCS.
Fixes #3182.

R=golang-dev, dvyukov, rsc
CC=golang-dev, remy
https://golang.org/cl/5732057
2012-03-05 16:40:27 -05:00
Brad Fitzpatrick
610b5b2fd8 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
2012-03-05 13:36:05 -08:00
Russ Cox
6e3a7930eb 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
2012-03-05 16:13:33 -05:00
Russ Cox
c0a842e57f 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
2012-03-05 16:13:15 -05:00
Brad Fitzpatrick
7300b43c2b 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
2012-03-05 12:20:58 -08:00
Brad Fitzpatrick
82a9294d1b 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
2012-03-05 11:43:28 -08:00
Russ Cox
eb5db57d1a cmd/go: sync type Package and go list doc
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5730061
2012-03-05 14:41:30 -05:00
Shenghou Ma
6e211225d7 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
2012-03-06 03:12:11 +08:00
Brad Fitzpatrick
1042d7d5ef expvar: add missing locking in String methods
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5726062
2012-03-05 11:09:50 -08:00
Rémy Oudompheng
c073a1602a cmd/go: honor buildflags in go test.
Fixes #3196.

R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/5725044
2012-03-05 19:58:04 +01:00
Russ Cox
cae604f734 cmd/gc: must not inline panic, recover
R=lvd, gri
CC=golang-dev
https://golang.org/cl/5731061
2012-03-05 13:51:44 -05:00
Russ Cox
5ab9d2befd cmd/gc: show duplicate key in error
R=ken2
CC=golang-dev
https://golang.org/cl/5728064
2012-03-05 13:47:36 -05:00
Paul Borman
1b311776c4 csv: clarify what a negative FieldsPerRecord means
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5729068
2012-03-05 13:34:12 -05:00
Russ Cox
8dbd9d746d encoding/json: document that nil slice encodes as null
Fixes #3189.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5730058
2012-03-05 13:29:22 -05:00
Russ Cox
8e5b34e580 godoc: quiet log spam
Fixes #3191.
Sorry.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5726059
2012-03-05 13:29:13 -05:00
Adam Langley
ed35d5e0fb 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
2012-03-05 12:08:42 -05:00
Adam Langley
52d6ca2f86 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
2012-03-05 12:04:18 -05:00
Adam Langley
6aed613030 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
2012-03-05 11:31:24 -05:00
Mikio Hara
b5dc8724cb 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
2012-03-06 00:13:10 +09:00
Russ Cox
fae0d35043 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
2012-03-05 10:02:46 -05:00
Stefan Nilsson
a347fdb035 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
2012-03-05 10:02:30 -05:00
Volker Dobler
06e18ca5a3 strings: Rename example to match function name.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5729065
2012-03-05 22:19:51 +11:00
Andrew Gerrand
7e8ed8f616 cmd: update formatting of usage messages
R=golang-dev, r, minux.ma
CC=golang-dev
https://golang.org/cl/5738045
2012-03-05 14:23:00 +11:00
Rob Pike
f5a1dd888d doc/progs: update for go 1
Fixes #3076.

R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/5727056
2012-03-05 12:49:31 +11:00
Rob Pike
2c0a46d604 cmd/go: fix grammar error in help messages
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5729061
2012-03-05 11:52:31 +11:00
Scott Lawrence
30f9c99e3e html/template: fix comment typo
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5730051
2012-03-05 10:58:43 +11:00
Mikio Hara
4d35583661 net: move MAC address parser into distinct file
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5727054
2012-03-05 07:42:07 +09:00
Andrew Gerrand
dd29609244 godoc: fix codewalks
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5732056
2012-03-04 11:53:07 +11:00
Rob Pike
227a04d771 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
2012-03-04 08:06:26 +11:00
Rob Pike
f1d3ff1660 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
2012-03-03 23:14:20 +11:00
Russ Cox
604f375110 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
2012-03-02 22:16:02 -05:00
Shenghou Ma
a142ed99d5 fix build for FreeBSD/amd64
R=rsc, golang-dev, iant
CC=golang-dev
https://golang.org/cl/5732043
2012-03-03 04:47:42 +08:00
Shenghou Ma
5aea33742a 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
2012-03-03 04:14:31 +08:00
Robert Griesemer
6474eda490 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
2012-03-02 11:16:05 -08:00
Robert Griesemer
de7361bf98 all: more typos
R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/5720044
2012-03-02 11:15:45 -08:00
Shenghou Ma
a3caf073a5 net: during short test, don't bother timeout longer than expected
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5716053
2012-03-03 00:50:18 +08:00
Rémy Oudompheng
1feecdd633 cmd/go: avoid repeated include dirs.
Fixes #3171.

R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/5724045
2012-03-02 11:31:13 -05:00
Russ Cox
d08a8848bb 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
2012-03-02 11:27:36 -05:00
Rémy Oudompheng
11e7eabb7e 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
2012-03-02 08:36:53 +01:00
Gustavo Niemeyer
7e19e53391 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
2012-03-02 02:45:01 -03:00