Commit Graph

11823 Commits

Author SHA1 Message Date
Rob Pike
9ce23548cb encoding/gob: document CommonType
Also bring the names in doc.go in line with the source.
More radical resolutions are possible but require substantial internal
changes for very little benefit. Fixing it this way lets us keep the
embedding, which has a huge simplifying effect, and guarantees
binary compatibility.

Fixes #2848.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5644045
2012-02-07 16:15:55 +11:00
Rob Pike
749f228cbd encoding/xml: fix documentation for Decoder.Skip
Fixes #2850.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5645043
2012-02-07 16:15:35 +11:00
Rob Pike
38b8f6c7a4 bufio: remove special error type, update docs
Updates #2836.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5639045
2012-02-07 16:15:03 +11:00
Andrew Gerrand
eb039a8045 misc/osx: update for dist tool, drop image.bash, update readme
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5639043
2012-02-07 14:37:57 +11:00
Gustavo Niemeyer
c2fe6634db cmd/dist: prevent race on VERSION creation
Commands such as "dist version > VERSION" will cause
the shell to create an empty VERSION file and set dist's
stdout to its fd. dist in turn looks at VERSION and uses
its content if available, which is empty at this point.

Fix that by ignoring VERSION if it's empty.

Also prevent cmdversion from running findgoversion a
second time. It was already loaded by init.

R=adg, gustavo, rsc
CC=golang-dev
https://golang.org/cl/5639044
2012-02-07 00:38:15 -02:00
Robert Griesemer
4151183e94 fix build: wrong godoc code submitted before
R=r
CC=golang-dev
https://golang.org/cl/5644044
2012-02-06 17:54:20 -08:00
Robert Griesemer
668418d122 go/token: remove dependency on encoding/gob
R=dsymonds
CC=golang-dev
https://golang.org/cl/5636053
2012-02-06 17:41:19 -08:00
Alex Brainman
1f133e2b8e net: run TestDialTimeout on windows
R=golang-dev, rsc
CC=bradfitz, golang-dev, mikioh.mikioh
https://golang.org/cl/5616066
2012-02-07 12:05:59 +11:00
Rob Pike
97ef437212 path/filepath: repair and simplify the symlink test
I hate symlinks.
Fixes #2787.

R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5638043
2012-02-07 11:00:13 +11:00
Andrew Gerrand
d887a31b7c misc/osx: don't set GOROOT or modify profile files
There's no reason to set GOROOT as the tools will have the path baked
into it with GOROOT_FINAL.

R=bradfitz, bytbox, gustavo, rsc
CC=golang-dev
https://golang.org/cl/5576064
2012-02-07 10:38:10 +11:00
Russ Cox
32f011e46b syscall: add Timeval.Nano, Timespec.Nano, for conversion to Duration
Fixes #2534.

R=golang-dev, dsymonds, bradfitz
CC=golang-dev
https://golang.org/cl/5635051
2012-02-06 18:04:12 -05:00
Rob Pike
fc06cadd88 go_spec: primality is elusive
This time for sure.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5634046
2012-02-07 06:59:36 +11:00
Rémy Oudompheng
0d07600de3 cgo: print line numbers in fatal errors when relevant.
Signatures of fatalf and error_ helpers have been matched for
consistency.
Fixes #1800.

R=rsc
CC=golang-dev, remy
https://golang.org/cl/5593049
2012-02-06 20:38:54 +01:00
Russ Cox
1c290fda50 build: add make.bash --dist-tool
R=golang-dev, n13m3y3r
CC=golang-dev
https://golang.org/cl/5634048
2012-02-06 13:48:43 -05:00
Russ Cox
ae7497bda6 doc: remove overuse of simply
Specifically, remove simply where it is claiming that the
code or the action to be carried out is simple, since the
reader might disagree.

R=golang-dev, bradfitz, gri
CC=golang-dev
https://golang.org/cl/5637048
2012-02-06 13:34:35 -05:00
Russ Cox
fec7fa8b9d build: delete make paraphernalia
As a convenience to people working on the tools,
leave Makefiles that invoke the go dist tool appropriately.
They are not used during the build.

R=golang-dev, bradfitz, n13m3y3r, gustavo
CC=golang-dev
https://golang.org/cl/5636050
2012-02-06 13:34:25 -05:00
Russ Cox
e335ec98b5 cmd/dist: ignore file names beginning with . or _
This is the same heuristic that build.ScanDir uses.
It avoids considering 'resource fork' files on OS X;
the resource for x.go is ._x.go.

R=gri
CC=golang-dev
https://golang.org/cl/5616073
2012-02-06 13:33:22 -05:00
Rémy Oudompheng
842c906e2e runtime: delete UpdateMemStats, replace with ReadMemStats(&stats).
Unexports runtime.MemStats and rename MemStatsType to MemStats.
The new accessor requires passing a pointer to a user-allocated
MemStats structure.

Fixes #2572.

R=bradfitz, rsc, bradfitz, gustavo
CC=golang-dev, remy
https://golang.org/cl/5616072
2012-02-06 19:16:26 +01:00
Brad Fitzpatrick
9c060b8d60 database/sql: permit scanning into interface{}
See thread http://goo.gl/7zzzU for background.

R=rsc
CC=golang-dev
https://golang.org/cl/5624051
2012-02-06 10:06:22 -08:00
Shenghou Ma
6392b43a15 8a, 8l: implement support for RDTSC instruction.
Also modify runtime/asm_386.s to use it.

R=rsc
CC=golang-dev
https://golang.org/cl/5634043
2012-02-06 12:49:28 -05:00
Anthony Martin
7ac03695f8 build: remove unnecessary pragmas
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5629055
2012-02-06 12:45:23 -05:00
Sanjay Menakuru
39611ec880 cmd/go: fixed panic on go clean -n and go clean -x.
also made generated scripts act more like running go clean itself

R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/5624049
2012-02-06 12:40:59 -05:00
Russ Cox
74ee51ee92 cmd/gc: disallow switch _ := v.(type)
Fixes #2827.

R=ken2
CC=golang-dev
https://golang.org/cl/5638045
2012-02-06 12:35:29 -05:00
Olivier Duperray
98257750f4 misc/goplay: use go tool "run"
Fixes #2872

R=andybalholm, rsc
CC=golang-dev
https://golang.org/cl/5608056
2012-02-06 12:10:49 -05:00
Jeff Hodges
eac86fd3f0 cmd/go: pass env CGO_CFLAGS to cgo
Passing the CGO_CFLAGS to cgo is required to make alternative include
directories work when building a cgo project.

R=rsc
CC=golang-dev
https://golang.org/cl/5635048
2012-02-06 11:26:15 -05:00
Russ Cox
facee93a86 runtime: fix float64 hash on 32-bit machine
Multiplying by the low 32 bits was a bad idea
no matter what, but it was a particularly unfortunate
choice because those bits are 0 for small integer values.

Fixes #2883.

R=ken2
CC=golang-dev
https://golang.org/cl/5634047
2012-02-06 11:24:34 -05:00
Russ Cox
48bd13911d runtime: use GOTRACEBACK to decide whether to show runtime frames
Right now, GOTRACEBACK=0 means do not show any stack traces.
Unset means the default behavior (declutter by hiding runtime routines).

This CL makes GOTRACEBACK=2 mean include the runtime routines.
It avoids having to recompile the runtime when you want to see
the runtime in the tracebacks.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5633050
2012-02-06 11:24:14 -05:00
Luuk van Dijk
0b9f090861 cmd/gc: another special (%hhS) case for method names.
Fixes #2877

R=rsc
CC=golang-dev
https://golang.org/cl/5637047
2012-02-06 16:38:59 +01:00
Luuk van Dijk
5efd5624cc cmd/gc: fix codegen reordering for expressions involving && and ||
Fixes #2821.

R=rsc
CC=golang-dev
https://golang.org/cl/5606061
2012-02-06 15:41:01 +01:00
Gustavo Niemeyer
02fb021161 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
2012-02-06 11:58:32 -02:00
Luuk van Dijk
419c53af30 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
2012-02-06 12:19:59 +01:00
Patrick Mylund Nielsen
fb86bbe239 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
2012-02-06 17:55:47 +11:00
David Symonds
f2d2b38c92 A+C: Patrick Mylund Nielsen (individual CLA)
R=golang-dev
TBR=adg
CC=golang-dev, patrick
https://golang.org/cl/5616070
2012-02-06 17:54:56 +11:00
Rob Pike
0a75a79cc0 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
2012-02-06 15:29:21 +11:00
Rob Pike
929203acef 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
2012-02-06 15:09:50 +11:00
Kyle Lemons
cb0de68a08 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
2012-02-06 14:10:03 +11:00
Rob Pike
5be24046c7 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
2012-02-06 14:09:00 +11:00
David Symonds
9440d823a5 gob: fuzz testing, plus a fix for very large type names.
Fixes #2689.

R=r
CC=golang-dev
https://golang.org/cl/5616063
2012-02-06 14:02:12 +11:00
David Symonds
cee920225d testing: capture panics, present them, and mark the test as a failure.
R=r
CC=golang-dev
https://golang.org/cl/5633044
2012-02-06 14:00:23 +11:00
Nigel Tao
e066db3acb html: add package doc.
Fixes #2857.

R=r, adg
CC=golang-dev
https://golang.org/cl/5635046
2012-02-06 13:24:45 +11:00
Anthony Martin
b9917045da net: fix Plan 9 build
R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/5631051
2012-02-05 16:59:32 -08:00
Rob Pike
1d2b19e2a3 .hgignore: delete more dregs
R=golang-dev, ality
CC=golang-dev
https://golang.org/cl/5636044
2012-02-06 11:25:28 +11:00
Rob Pike
d31d9201d6 .hgignore: delete dregs
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5634045
2012-02-06 11:09:38 +11:00
Nigel Tao
8fc87c957c 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
2012-02-06 11:04:12 +11:00
Andrew Gerrand
22185aed74 dashboard: update to go1beta
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5624056
2012-02-06 09:26:32 +11:00
Alex Brainman
c06bd52a2e cmd/dist: fix bug in bsubst
R=golang-dev, r, dsymonds, akumar
CC=golang-dev
https://golang.org/cl/5624054
2012-02-05 15:16:39 +11:00
David Symonds
cdfd5b2bed build: fix sudo.bash.
R=rsc, balasanjay, rsc
CC=golang-dev
https://golang.org/cl/5630051
2012-02-05 14:50:38 +11:00
Gustavo Niemeyer
8f0602fb07 .hgignore: add VERSION.cache
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5627051
2012-02-05 00:36:20 -02:00
Gustavo Niemeyer
1d69b12445 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
2012-02-05 00:35:08 -02:00
David Symonds
2943ca6b35 doc/go1.html: style tweak for expvar notes.
R=r
CC=golang-dev
https://golang.org/cl/5608061
2012-02-04 21:55:38 +11:00