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

9103 Commits

Author SHA1 Message Date
Shenghou Ma
9a4487458a all: update 'gotest' to 'go test'
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5645099
2012-02-13 13:58:17 -05:00
Darren Elwood
aaac05ae23 8a, 8l: add LFENCE, MFENCE, SFENCE
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5650076
2012-02-13 13:58:12 -05:00
Russ Cox
35586f718c os/signal: selective signal handling
Restore package os/signal, with new API:
Notify replaces Incoming, allowing clients
to ask for certain signals only.  Also, signals
go to everyone who asks, not just one client.

This could plausibly move into package os now
that there are no magic side effects as a result
of the import.

Update runtime for new API: move common Unix
signal handling code into signal_unix.c.
(It's so easy to do this now that we don't have
to edit Makefiles!)

Tested on darwin,linux 386,amd64.

Fixes #1266.

R=r, dsymonds, bradfitz, iant, borman
CC=golang-dev
https://golang.org/cl/3749041
2012-02-13 13:52:37 -05:00
Adam Langley
cdd7e02583 crypto/...: more fixes for bug 2841
1) Remove the Reset() member in crypto/aes and crypto/des (and
   document the change).
2) Turn several empty error structures into vars. Any remaining error
   structures are either non-empty, or will probably become so in the
   future.
3) Implement SetWriteDeadline for TLS sockets. At the moment, the TLS
   status cannot be reused after a Write error, which is probably fine
   for most uses.
4) Make crypto/aes and crypto/des return a cipher.Block.

R=rsc, r
CC=golang-dev
https://golang.org/cl/5625045
2012-02-13 12:38:45 -05:00
Marcel van Lohuizen
a52fb458df exp/norm: merged charinfo and decomposition tables. As a result only
one trie lookup per rune is needed. See forminfo.go for a description
of the new format.  Also included leading and trailing canonical
combining class in decomposition information.  This will often avoid
additional trie lookups.

R=r, r
CC=golang-dev
https://golang.org/cl/5616071
2012-02-13 14:54:46 +01:00
Andrew Gerrand
d84de09e1d godoc: new design
This is not the finished product,
but a good checkpoint from which to
proceed with further development.

R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/5571061
2012-02-13 21:22:36 +11:00
Anthony Martin
dbec42104f gc, 8g, 8l: fix a handful of warnings
8g/cgen.c
        print format type mismatch

8l/asm.c
        resoff set and not used

gc/pgen.c
        misleading comparison INT > 0x80000000

gc/reflect.c
        dalgsym must be static to match forward declaration

gc/subr.c
        assumed_equal set and not used
        hashmem's second argument is not used

gc/walk.c
        duplicated (unreachable) code

R=rsc
CC=golang-dev
https://golang.org/cl/5651079
2012-02-12 23:07:31 -08:00
Ian Lance Taylor
c53b73455b sync/atomic: disable hammer pointer tests on wrong size system
hammerCompareAndSwapPointer64 was only passing on
little-endian systems.  hammerCompareAndSwapPointer32 was
writing 8 bytes to a uint32 value on the heap.

R=rsc, dvyukov
CC=golang-dev
https://golang.org/cl/5654065
2012-02-12 21:53:33 -08:00
Russ Cox
b440a65033 strconv: disable issue 2917 test
It did in fact break on the darwin/386 builder.
Will investigate later; reopened issue 2917.

R=golang-dev
CC=golang-dev
https://golang.org/cl/5654070
2012-02-13 00:19:18 -05:00
Russ Cox
65ba8ee07e syscall: make linux Dup2 match other systems
You could argue for changing all the others, but
Linux is outvoted, and the only time it matters
is when newfd==-1, in which case you can call Dup.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5650073
2012-02-13 00:11:36 -05:00
Russ Cox
878153682e cmd/fix: warn about exp, old, deleted packages
Fixes #2776.

There was a previous attempt at CL 5592043 but that
seems to have stalled.  This one is simpler, and more up to date
(correct handling of spdy, for example).

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5645091
2012-02-12 23:55:33 -05:00
Hong Ruiqi
c58b6ad022 net/http: use mtime < t+1s to check for unmodified
The Date-Modified header truncates sub-second precision, so
use mtime < t+1s instead of mtime <= t to check for unmodified.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5655052
2012-02-12 23:45:19 -05:00
Russ Cox
8bcfad269e testing: use runtime/debug to format panics
Sorry, Mercurial failed me.

TBR=r, dsymonds
CC=golang-dev
https://golang.org/cl/5649080
2012-02-12 23:41:07 -05:00
Russ Cox
f735d2d9d3 testing: use runtime/debug to format panics
Among other things, this avoids putting a testing.go:nnn:
prefix on every line of the stack trace.

R=golang-dev, r, dsymonds, r
CC=golang-dev
https://golang.org/cl/5651081
2012-02-12 23:39:40 -05:00
Russ Cox
6a75ece01c runtime: delete Type and implementations (use reflect instead)
unsafe: delete Typeof, Reflect, Unreflect, New, NewArray

Part of issue 2955 and issue 2968.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5650069
2012-02-12 23:26:20 -05:00
Russ Cox
cbe7d8db24 net: avoid TCP self-connect
Fixes #2690.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5650071
2012-02-12 23:25:55 -05:00
Russ Cox
f7a3683928 strconv: add tests for issue 2917
Cannot reproduce the failure locally,
but add explicit test in case some other
machine can.

Fixes #2917 (for now).

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5651071
2012-02-12 23:24:54 -05:00
Rob Pike
daa7bd8ec6 net/http/pprof: link to blog post
Fixes #2943.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5649079
2012-02-13 15:24:06 +11:00
Russ Cox
fb2caa3244 net/http: fix http_proxy parsing
Fixes #2919.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5645089
2012-02-12 23:19:50 -05:00
Russ Cox
d318ab2264 cmd/go: respect test -timeout flag
I thought that -timeout was per-test, but it is for the
whole program execution, so cmd/go can adjust its timer
(also for whole program execution) accordingly.

Fixes #2993.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5650070
2012-02-12 23:19:24 -05:00
Russ Cox
aa87d78cf6 cmd/dist: encoding/gob is no longer required for cmd/go
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5650068
2012-02-12 23:15:07 -05:00
Russ Cox
d9da346078 net/http: document use of DetectContentType
Fixes #2365.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5653070
2012-02-12 23:14:48 -05:00
Russ Cox
b5d81e5ed5 build: reject make.bash on Windows
Also, echo cmd/dist during bootstrap build
Makes that phase look like all the others.

Fixes #2908.

R=golang-dev, alex.brainman, bradfitz
CC=golang-dev
https://golang.org/cl/5655065
2012-02-12 23:14:37 -05:00
Mikio Hara
6fa2296e83 net: disable wild use of SO_REUSEPORT on BSD variants
Fixes #2830 (again).

R=rsc
CC=golang-dev
https://golang.org/cl/5651083
2012-02-13 12:45:59 +09:00
Gustavo Niemeyer
62fe6914cb os: clarify docs for link functions
R=golang-dev, bsiegert, r
CC=golang-dev
https://golang.org/cl/5643068
2012-02-13 01:21:39 -02:00
Brad Fitzpatrick
71c8b82dd1 strings: more examples
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5645092
2012-02-13 14:05:57 +11:00
Yves Junqueira
7531e8cb39 pprof: fix import path in the documentation
R=golang-dev, n13m3y3r
CC=golang-dev
https://golang.org/cl/5649072
2012-02-12 12:38:51 -02:00
Mikio Hara
9387d11aa6 net: fix windows build
R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/5653066
2012-02-12 15:59:21 +09:00
Anthony Martin
8bd0109dd0 build: get rid of deps.bash
It doesn't work anymore and it's not used.

R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5652073
2012-02-11 20:02:50 -08:00
Bjorn Tipling
5b663057b7 html/template: Added more explicit wording about examples and documentation.
R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/5654062
2012-02-12 12:18:00 +11:00
Rob Pike
d26c607fe6 unsafe: Alignof and Offsetof now use the same style
The easy part of issue 2968.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5655059
2012-02-12 09:10:47 +11:00
Russ Cox
7dd90621f8 gc: diagnose field+method of same name
Fixes #2828.

R=ken2
CC=golang-dev
https://golang.org/cl/5653065
2012-02-11 01:21:12 -05:00
Russ Cox
2aafad25b4 gc: print detail for typechecking loop error
R=ken2
CC=golang-dev
https://golang.org/cl/5654060
2012-02-11 01:04:33 -05:00
Russ Cox
2f3d695a61 gc: fix bug introduced earlier
Apparently l and $1 were the same register on Linux.
On the other systems, the compiler caught it.

R=ken2
CC=golang-dev
https://golang.org/cl/5654061
2012-02-11 01:04:24 -05:00
Russ Cox
337547d1c9 gc: make constant arith errors a little more friendly
Fixes #2804.

R=ken2
CC=golang-dev
https://golang.org/cl/5652067
2012-02-11 00:50:56 -05:00
Robert Griesemer
2233942e3c gofmt: fix error message in test
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5652066
2012-02-10 21:47:18 -08:00
Russ Cox
77aaa3555d gc: fix import of struct type in struct literal
Fixes #2716.

R=ken2
CC=golang-dev
https://golang.org/cl/5652065
2012-02-11 00:34:01 -05:00
Ian Lance Taylor
53e139c7a0 runtime: put lockorder before pollorder in Select memory block.
Otherwise lockorder may be misaligned, since lockorder is a
list of pointers and pollorder is a list of uint16.
Discovered running gccgo (which uses a modified copy of this
code) on SPARC.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5655054
2012-02-10 21:24:14 -08:00
Russ Cox
f91cc3bdbb gc: optimize interface ==, !=
If the values being compared have different concrete types,
then they're clearly unequal without needing to invoke the
actual interface compare routine.  This speeds tests for
specific values, like if err == io.EOF, by about 3x.

benchmark                  old ns/op    new ns/op    delta
BenchmarkIfaceCmp100             843          287  -65.95%
BenchmarkIfaceCmpNil100          184          182   -1.09%

Fixes #2591.

R=ken2
CC=golang-dev
https://golang.org/cl/5651073
2012-02-11 00:19:24 -05:00
Russ Cox
a7b83f2287 5g: fix out of registers bug
Same fix as 6g, tripped by the 6g test case.

R=ken2
CC=golang-dev
https://golang.org/cl/5651074
2012-02-11 00:04:37 -05:00
Mikio Hara
f842dc160b cmd/dist: clear execute bit from source file
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5651072
2012-02-11 13:23:44 +09:00
Russ Cox
896f0c61c8 gc: diagnose init loop involving func
Fixes #2295.

R=ken2
CC=golang-dev
https://golang.org/cl/5655057
2012-02-10 23:10:45 -05:00
Russ Cox
7ae1fe420e gc: eliminate duplicate ambiguous selector message
Also show actual expression in message when possible.

Fixes #2599.

R=ken2
CC=golang-dev
https://golang.org/cl/5654059
2012-02-10 22:46:56 -05:00
Russ Cox
5340510203 8g: fix opt bug
Was trying to optimize a duplicate float64 move
by registerizing an int64.

Fixes #2588.

R=ken2
CC=golang-dev
https://golang.org/cl/5645086
2012-02-10 22:32:02 -05:00
Rob Pike
b027a0f118 text/template/parse: deep Copy method for nodes
This will help html/template copy templates.

R=golang-dev, gri, nigeltao, r
CC=golang-dev
https://golang.org/cl/5653062
2012-02-11 14:21:16 +11:00
Russ Cox
ca5da31f83 6g: fix out of registers bug
Fix it twice: reuse registers more aggressively in cgen abop,
and also release R14 and R15, which are no longer m and g.

Fixes #2669.

R=ken2
CC=golang-dev
https://golang.org/cl/5655056
2012-02-10 22:19:34 -05:00
Mikio Hara
76a1cb5a00 net: fix comment, make use of listenerBacklog
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5653056
2012-02-11 11:51:12 +09:00
Mikio Hara
0e3514eaac net: enable SO_REUSEADDR, SO_REUSEPORT options on stream, multicast listeners only
This CL changes default SOL_SOCKET settings to mitigate connect
failure on OpenBSD or similar platforms which support randomized
transport protocol port number assignment.

Fixes #2830.

R=rsc, jsing
CC=golang-dev
https://golang.org/cl/5648044
2012-02-11 11:50:51 +09:00
Robert Griesemer
21a3aceb4a fix build: update image/png test
R=nigeltao
CC=golang-dev
https://golang.org/cl/5649062
2012-02-10 17:26:40 -08:00
Nigel Tao
22636be8b0 flate: delete WrongValueError type.
Fixes #2838.

R=rsc, r
CC=golang-dev
https://golang.org/cl/5651060
2012-02-11 12:09:11 +11:00
Bjorn Tipling
0846e275a8 net/http: fix reference to URL.RawPath in docs
R=go.peter.90, n13m3y3r, gustavo
CC=golang-dev
https://golang.org/cl/5655053
2012-02-10 22:39:57 -02:00
Gustavo Niemeyer
dbac863ed8 cmd/dist: reset version during bootstrap
Fixes #2927.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5651062
2012-02-10 22:26:36 -02:00
Nigel Tao
18f518362b compress: add comments to gzip and zlib.
Fixes #2939.

R=rsc, r
CC=golang-dev
https://golang.org/cl/5655050
2012-02-11 09:42:07 +11:00
Luuk van Dijk
e0b2ce3401 cmd/gc: suspend safemode during typecheck of inlined bodies.
Should be obviously correct.  Includes minimal test case.
A future CL should clear up the logic around typecheckok and importpkg != nil someday.

R=rsc, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5652057
2012-02-10 22:50:55 +01:00
Brad Fitzpatrick
fbab6d8512 os,syscall: fix windows build
make syscall.ProcAttr.Files be []uintptr

all.bash passes on Linux.
things seem to compile on GOOS={darwin,windows}

R=golang-dev, mattn.jp, alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/5653055
2012-02-11 08:47:19 +11:00
James Whitehead
09f6a49194 exp/types: Use build.FindTree in GcImporter
Fixes #2932

R=gri
CC=golang-dev
https://golang.org/cl/5654046
2012-02-10 13:35:03 -08:00
Robert Griesemer
a0acdd210b go/printer: test that formatted code is parseable
- Added test case for issue 1542.

Fixes #1542.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5645080
2012-02-10 13:28:29 -08:00
Robert Griesemer
f8cf82f6f2 go/printer: implement SourcePos mode
If a printer is configured with the SourcePos mode
set, it will emit //-line comments as necessary to
ensure that the result - if reparsed - reflects the
original source position information.

This change required a bit of reworking of the
output section in printer.go. Specifically:

- Introduced new Config mode 'SourcePos'.

- Introduced new position 'out' which tracks the
position of the generated output if it were read
in again. If there is a discrepancy between out
and the current AST/source position, a //line
comment is emitted to correct for it.

- Lazy emission of indentation so that //line
comments can be placed correctly. As a result,
the trimmer will have to do less work.

- Merged writeItem into writeString.

- Merged writeByteN into writeByte.

- Use a []byte instead of a byte.Buffer both in the
printer and in the trimmer (eliminates dependency).

Also: introduced explicit printer.Mode type (in
sync w/ parser.Mode, scanner.Mode, etc.)

Runs all tests. Applied gofmt to src, misc w/o changes.

Fixes #1047.
Fixes #2697.

R=rsc, rsc
CC=golang-dev
https://golang.org/cl/5643066
2012-02-10 13:27:32 -08:00
Nigel Tao
cc9ed447d0 compress: make flate, gzip and zlib's NewWriterXxx functions all return
(*Writer, error) if they take a compression level, and *Writer otherwise.
Rename gzip's Compressor and Decompressor to Writer and Reader, similar to
flate and zlib.

Clarify commentary when writing gzip metadata that is not representable
as Latin-1, and fix io.EOF comment bug.

Also refactor gzip_test to be more straightforward.

Fixes #2839.

R=rsc, r, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/5639057
2012-02-10 18:49:19 +11:00
Russ Cox
0bc6836e81 builder: set $GOBUILDEXIT for Windows
Actually %GOBUILDEXIT% I suppose.

R=golang-dev
CC=golang-dev
https://golang.org/cl/5651058
2012-02-10 01:27:59 -05:00
Russ Cox
ce63ec93ce regexp/syntax: delete old package comment
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5651057
2012-02-10 01:11:56 -05:00
Alex Brainman
62b328ed19 all.bat: report error code back to the gobuilder
not sure that it will work, but.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5649051
2012-02-10 16:29:50 +11:00
Andrew Gerrand
08e11187e6 debug/macho: dropped monstrous URL from package comment
Relax. It's still in macho.go.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5653054
2012-02-10 16:03:24 +11:00
Rob Pike
1ceb561629 regexp/syntax: add package and Parse commentary
Fixes #2954.

R=golang-dev, bradfitz, rsc, r
CC=golang-dev
https://golang.org/cl/5645077
2012-02-10 15:57:12 +11:00
Rob Pike
13443ccc2a math: fix gamma doc, link to OEIS
Fixes #2940.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5645078
2012-02-10 15:56:51 +11:00
Daniel Theophanes
ef1d2a32ea dist: prevent recusive loop on windows when fatal() is called.
Fixes #2931.

R=golang-dev, alex.brainman
CC=golang-dev, rsc
https://golang.org/cl/5651049
2012-02-09 23:10:27 -05:00
Rob Pike
9bcfc57660 reflect: documentation tweaks
Fixes #2952.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5651054
2012-02-10 15:09:09 +11:00
Brad Fitzpatrick
5d198bf866 os/exec: add Cmd.Waitmsg, fix a misleading comment
Fixes #2948

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5655048
2012-02-10 14:52:08 +11:00
Rob Pike
4c7695126d strings: delete method comments implied by interface satisfaction
Fixes #2957.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5653053
2012-02-10 14:45:11 +11:00
Rob Pike
3f1cff3951 testing/quick: documentation tweaks
Fixes #2960.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5652055
2012-02-10 14:37:50 +11:00
Rob Pike
1308f7c94f testing/iotest: adjust adverbial imprecision in package comment
Fixes #2959.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5651053
2012-02-10 14:37:20 +11:00
Rob Pike
cbd6c34131 testing/script: delete
Dead code.

Fixes #2961.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5650053
2012-02-10 14:31:08 +11:00
Rob Pike
989e611a7b unicode: various documentation tweaks
The comment on IsOneOf regarding Latin-1 was an implementation detail:
when the function is called internally, that condition is true. It used to matter,
but now the comment is a dreg. The function works fine if the character is
Latin-1, so we just delete the comment.

Fixes #2966.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5655047
2012-02-10 14:30:44 +11:00
Rob Pike
0357af80b4 template: refer HTML users to html/template
Fixes #2963.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5650051
2012-02-10 14:21:36 +11:00
Brad Fitzpatrick
4152b43457 os: delete Exec, NewFile takes uintptr, rename ShellExpand, doc fixes
Delete O_NDELAY, O_NONBLOCK, O_NOCTTY, O_ASYNC.

Clean up some docs.

Rename ShellExpand -> ExpandEnv.

Make NewFile take a uintptr; change File.Fd to return one.
(for API compatibility between Unix and Windows)

Fixes #2947

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5655045
2012-02-10 14:16:15 +11:00
Rob Pike
6c0aa2f296 unicode/utf8: document return value for decode errors
Also replace archaic definition of rune.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5654048
2012-02-10 14:12:17 +11:00
Rob Pike
1bfffb67d8 time: improve commentary about standard time and formatting/parsing
Fixes #2965.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5652054
2012-02-10 13:52:19 +11:00
Rob Pike
7ef97def80 testing: fix references to "gotest"
Fixes #2958.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5650050
2012-02-10 13:49:50 +11:00
Alex Brainman
9a469e6ab5 make.bat: remove double quotes
Fixes #2974.

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/5653052
2012-02-10 11:48:22 +11:00
Brad Fitzpatrick
7750fc894a os: remove Time; callers should use time.Time.
Part of issue 2947

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5651051
2012-02-10 11:44:51 +11:00
Brad Fitzpatrick
0a398c4057 net/http/fcgi: don't mention threads in docs
Fixes #2942

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5650049
2012-02-10 10:29:57 +11:00
Robert Griesemer
88a9e76e28 text/scanner: update comments
Fixes #2962.

R=rsc
CC=golang-dev
https://golang.org/cl/5652048
2012-02-09 15:26:08 -08:00
Brad Fitzpatrick
9cd4a0467a regexp: name result parameters referenced from docs
Fixes #2953

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5653051
2012-02-10 10:22:01 +11:00
Brad Fitzpatrick
6bdd791dec database/sql: remove Into from ScannerInto/ScanInto
Also fix a doc error.

Fixes #2843

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/5653050
2012-02-10 10:20:49 +11:00
Rob Pike
44fa114dc6 container/heap: add example
godoc doesn't have the fu to present the example well, but this gives
us an example of an example to develop example fu.

Fixes #2840.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5645063
2012-02-10 10:07:55 +11:00
Brad Fitzpatrick
c15a42ed76 cmd/api: follow constant references
For gccgo. Also removes bunch of special cases.

Fixes #2906

R=golang-dev, remyoudompheng
CC=golang-dev
https://golang.org/cl/5644050
2012-02-10 10:05:26 +11:00
Brad Fitzpatrick
4539d1f307 net/http: add ServeContent
Fixes #2039

R=r, rsc, n13m3y3r, r, rogpeppe
CC=golang-dev
https://golang.org/cl/5643067
2012-02-10 10:02:06 +11:00
Rob Pike
59dc21584a encoding/binary: another attempt to describe the type of Read and Write's data
R=golang-dev, rsc, gri, r
CC=golang-dev
https://golang.org/cl/5641062
2012-02-10 09:55:48 +11:00
Gustavo Niemeyer
54f1e1b163 cmd/dist: fix GOROOT_FINAL
R=rsc, gustavo
CC=golang-dev
https://golang.org/cl/5642045
2012-02-09 20:47:12 -02:00
Rob Pike
eb02b9cf9c encoding/hex: vet the test prints
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5642075
2012-02-10 09:44:56 +11:00
Alex Brainman
309863aec4 compress/gzip: remove dead code
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5645074
2012-02-10 09:33:51 +11:00
Andrew Balholm
aca4a6c933 database/sql: support ErrSkip in Tx.Exec
If the database driver supports the Execer interface but returns
ErrSkip, calling Exec on a transaction was returning the error instead
of using the slow path.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5654044
2012-02-10 09:19:22 +11:00
Alex Brainman
eaf640dbc4 cmd/dist: do not use HEAP_GENERATE_EXCEPTIONS flag
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5650048
2012-02-10 09:14:00 +11:00
Brad Fitzpatrick
00651a2e63 database/sql: rename ErrTransactionFinished to ErrTxDone
Part of issue 2843

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5646063
2012-02-10 09:12:32 +11:00
Shenghou Ma
bb40196ebf runtime: Linux/ARM: exit early on OABI systems, and give an error message
Fixes #2533.

R=rsc
CC=golang-dev
https://golang.org/cl/5654045
2012-02-09 16:18:21 -05:00
Brad Fitzpatrick
396170da9b strings: add Seek method to Reader
strings.Reader is already stateful and read-only.

This permits a *Reader with http.ServeContent.

R=golang-dev, r, rsc, rsc
CC=golang-dev
https://golang.org/cl/5639068
2012-02-09 17:28:41 +11:00
Rob Pike
be0f6febad os: talk about errors and PathError in the package documentation
Fixes #2383.

R=golang-dev, bradfitz, adg, rsc
CC=golang-dev
https://golang.org/cl/5641061
2012-02-09 16:55:36 +11:00
Russ Cox
1253c75cf5 runtime: fix compiler warnings
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5642068
2012-02-09 16:48:52 +11:00
Brad Fitzpatrick
ce57ba9fee net/http/httptest: add a test
Less ironic. Don't you think?

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5643069
2012-02-09 16:45:24 +11:00
Russ Cox
5c52404aca gc: implicit type bug fix in export data
TBR=lvd
CC=golang-dev
https://golang.org/cl/5644064
2012-02-09 00:26:08 -05:00
Brad Fitzpatrick
29df93735c database/sql: more tests
Higher level tests for the pointer parameters
and scanning, complementing the existing ones
included in the previous CL.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5646050
2012-02-09 15:01:29 +11:00
Rob Pike
1c1ecd7473 log/syslog: fix documentation for NewLogger
Fixes #2798.

R=golang-dev, bradfitz, r, rsc, rsc
CC=golang-dev
https://golang.org/cl/5642071
2012-02-09 14:40:56 +11:00
Rob Pike
c0e74b63cf fmt: scan FALSE correctly
Fixes bug 2922.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5642072
2012-02-09 14:12:55 +11:00
Rob Pike
00d0f8e320 cmd/go: rearrange help for 'go test'
Put the 'go test' flags into 'go help test', so 'go help testflags'
is about the flags for the compiled test binary.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5641060
2012-02-09 14:12:18 +11:00
Brad Fitzpatrick
3484d5462d net/http: remove an errant space
Made the godoc overview section oddly indented
compared to the other code blocks.

R=golang-dev, mikioh.mikioh, dsymonds, r
CC=golang-dev
https://golang.org/cl/5645060
2012-02-09 14:10:36 +11:00
Gary Burd
e7bd71c83a go/doc: Handle recursive embedded types.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5645053
2012-02-08 16:54:48 -08:00
Rob Pike
025c9a946d encoding/binary: slices are allowed; say so
Fixes #2629.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5642069
2012-02-09 11:42:10 +11:00
Rob Pike
8c4a2ca83b encoding/binary: add Size, to replace the functionality of the old TotalSize
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5644063
2012-02-09 11:26:03 +11:00
Mikio Hara
d082e5976e text/template/parse: fix comment
R=r, rsc
CC=golang-dev
https://golang.org/cl/5644055
2012-02-09 07:47:48 +09:00
Shenghou Ma
073aeff785 runtime: fix "SysReserve returned unaligned address" bug on 32-bit systems
R=rsc
CC=golang-dev
https://golang.org/cl/5642064
2012-02-09 09:25:10 +11:00
Rob Pike
c59dc485cd bytes.Buffer: return error in WriteTo if buffer is not drained
R=rsc
CC=golang-dev
https://golang.org/cl/5642065
2012-02-09 08:58:40 +11:00
Rob Pike
3fce00d99e log/syslog: return length of data provided by the user, not length of header
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5644059
2012-02-09 08:36:13 +11:00
Shenghou Ma
119917375b cmd/dist: redure max background tasks nr. when building on ARM
R=rsc
CC=golang-dev
https://golang.org/cl/5642063
2012-02-08 16:26:00 -05:00
Russ Cox
56ade2d8d5 cmd/go: let go tool invocation use stdin
Fixes #2921.

R=golang-dev, n13m3y3r
CC=golang-dev
https://golang.org/cl/5647057
2012-02-08 16:14:24 -05:00
Russ Cox
596840a905 cmd/dist: make 'make' quieter for developers
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5646055
2012-02-08 15:26:47 -05:00
Robert Griesemer
d08dd8bec1 go/scanner: clean up error interface
Issue 2856 asks for a rename of a few methods to a
more idiomatic Go style. This is a very early API
that evolved organically throughout the years.
Together with the fact that ErrorVectors were embedded
in other data structures (e.g. Parser), just renaming
methods (e.g. GetError -> Error) would lead to undesired
behavior (e.g., Parser would act like an Error). Instead,
cleaned up API a bit more:

- removed ErrorVector in favor of ErrorList (already
present)
- simplified Scanner.Init by making the error handler a
function instead of requiring an ErrorHandler implementation
- adjusted helper functions accordingly
- updated Go 1 doc

Fixes #2856.

R=rsc
CC=golang-dev
https://golang.org/cl/5624047
2012-02-08 11:41:32 -08:00
Paul Borman
d37a8b73c5 runtime: drop to 32 bit malloc if 64 bit will not work
On 64 bit UML it is not possible to reserve memory at 0xF8<<32.
Detect when linux cannot use these high virtual memory addresses
and drop back to the 32 bit memory allocator.

R=rsc, cw
CC=golang-dev
https://golang.org/cl/5634050
2012-02-08 14:39:16 -05:00
Shenghou Ma
1127b22976 cmd/dist: pass correct -DGOARCH_$GOARCH flag to gcc.
R=rsc
CC=golang-dev
https://golang.org/cl/5643061
2012-02-08 14:36:38 -05:00
Russ Cox
d0dc68901a net/http: panic on duplicate registrations
Otherwise, the registration semantics are
init-order-dependent, which I was trying very hard
to avoid in the API.  This may break broken programs.

Fixes #2900.

R=golang-dev, r, bradfitz, dsymonds, balasanjay, kevlar
CC=golang-dev
https://golang.org/cl/5644051
2012-02-08 13:50:00 -05:00
Russ Cox
49110eaa22 encoding/json: document buffering
Fixes #1955.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5643058
2012-02-08 13:48:03 -05:00
Robert Griesemer
467f8751f9 gofmt: replace defunct test.sh with a go test
R=r, rsc
CC=golang-dev
https://golang.org/cl/5639053
2012-02-08 08:47:02 -08:00
Dmitriy Vyukov
bd37349485 cmd/dist: fix copying of cmd/prof
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5642059
2012-02-08 20:15:17 +04:00
Russ Cox
136f12f51f cmd/dist: pass -m32 or -m64 to link too, not just compile
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5646053
2012-02-08 11:12:14 -05:00
Russ Cox
5b93fc9da6 runtime, pprof: add profiling of thread creation
Same idea as heap profile: how did each thread get created?
Low memory (256 bytes per OS thread), high reward for
programs that suddenly have many threads running.

Fixes #1477.

R=golang-dev, r, dvyukov
CC=golang-dev
https://golang.org/cl/5639059
2012-02-08 10:33:54 -05:00
Jamie Gennis
fff732ea2c 6g,8g: make constant propagation inlining-friendly.
This changes makes constant propagation compare 'from' values using node
pointers rather than symbol names when checking to see whether a set
operation is redundant. When a function is inlined multiple times in a
calling function its arguments will share symbol names even though the values
are different. Prior to this fix the bug409 test would hit a case with 6g
where an LEAQ instruction was incorrectly eliminated from the second inlined
function call. 8g appears to have had the same bug, but the test did not fail
there.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5646044
2012-02-08 10:25:13 -05:00
Russ Cox
5957f914e2 regexp: fix typo
Fixes #2918.

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5639062
2012-02-08 08:59:59 -05:00
Andrew Pritchard
cc39bb9068 database/sql: treat pointers as nullable types like encoding/json
- convert from nil pointers to the nil interface{}
- dereference non-nil pointers
- convert from nil interface{}s to nil pointers
- allocate pointers for non-nil interface{}s
- tests for all of the above

R=golang-dev, bradfitz, rsc, rogpeppe
CC=golang-dev
https://golang.org/cl/5630052
2012-02-08 17:14:15 +11:00
Brad Fitzpatrick
878608bd29 cmd/go: connect os.Stdin for go run
Fixes #2875

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/5641052
2012-02-08 16:30:28 +11:00
Russ Cox
3f6a517db6 cmd/dist: respect $CC, as quietgcc.bash used to
R=golang-dev, r, iant
CC=golang-dev
https://golang.org/cl/5641051
2012-02-08 00:22:38 -05:00
Russ Cox
7201ba2171 regexp: allow substitutions in Replace, ReplaceString
Add Expand, ExpandString for access to the substitution functionality.

Fixes #2736.

R=r, bradfitz, r, rogpeppe, n13m3y3r
CC=golang-dev
https://golang.org/cl/5638046
2012-02-07 23:46:47 -05:00
Russ Cox
1d8250c8b0 time: clean up MarshalJSON, add RFC3339 method
encoding/xml: handle time.Time as recognized type

The long term plan is to define an interface that time.Time
can implement and that encoding/xml can call, but we are
not going to try to define that interface before Go 1.
Instead, special-case time.Time in package xml, because
it is such a fundamental type, as a stop-gap.
The eventual methods will behave this way.

Fixes #2793.

R=golang-dev, r, r, n13m3y3r
CC=golang-dev
https://golang.org/cl/5634051
2012-02-07 23:37:25 -05:00
Russ Cox
3ee208533e strconv: handle very large inputs
Fixes #2642.

R=remyoudompheng, r, r
CC=golang-dev
https://golang.org/cl/5639052
2012-02-07 23:37:15 -05:00
Russ Cox
00134fe8ef fmt: diagnose invalid verb applied to pointer
Fixes #2851.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5644048
2012-02-07 23:37:05 -05:00
Rob Pike
0bd53d2ce0 runtime/cgo: silence warning on windows
It appears to want a * on an indirect function call (assembly language)

TBR=rsc

R=golang-dev
CC=golang-dev
https://golang.org/cl/5643054
2012-02-08 15:26:36 +11:00
Rob Pike
9af4b01654 5l: attempt to fix arm build
TBR=rsc

R=golang-dev
CC=golang-dev
https://golang.org/cl/5647049
2012-02-08 15:12:56 +11:00
Gustavo Niemeyer
0a7ad329e1 encoding/xml: add support for the omitempty flag
This also changes the behavior of attribute marshalling so
that strings and byte slices are marshalled even if empty.
The omitempty flag may be used to obtain the previous behavior.

Fixes #2899.

R=rsc
CC=golang-dev
https://golang.org/cl/5645050
2012-02-08 01:57:44 -02:00
Andrew Gerrand
0a6e2461e3 archive/zip: tweak API and docs.
Fixes #2835.

R=golang-dev, n13m3y3r, r, bradfitz
CC=golang-dev
https://golang.org/cl/5645051
2012-02-08 14:34:40 +11:00
Rob Pike
90d43ad720 encoding/csv: document ReadAll behavior at EOF
Fixes #2847.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5641050
2012-02-08 14:24:04 +11:00
Brad Fitzpatrick
c02db82b83 net/http: don't ignore some errors in tests
to help debug Issue 2651

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5644049
2012-02-07 19:15:25 -08:00
Rob Pike
52ebadd356 encoding/binary: hide TotalSize
The function has a bizarre signature: it was the only public function there
that exposed the reflect package. Also, its definition is peculiar and hard to
explain. It doesn't merit being exported.

This is an API change but really, it should never have been exported and
it's certain very few programs will depend on it: it's too weird.

Fixes #2846.

R=golang-dev, gri, bradfitz
CC=golang-dev
https://golang.org/cl/5639054
2012-02-08 14:09:20 +11:00
Brad Fitzpatrick
f23a6dba5e cmd/api: compare multiple contexts
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5626045
2012-02-07 18:13:11 -08:00
Rob Pike
bb7b1a11d5 bufio: drop error return for NewReaderSize and NewWriterSize
It complicates the interface unnecessarily.
Document this in go1.html.
Also update the go/doc Makefile.

Fixes #2836.

R=golang-dev, gri, bradfitz
CC=golang-dev
https://golang.org/cl/5642054
2012-02-08 13:07:13 +11:00
Brad Fitzpatrick
518ee115b7 net/http/httputil: preserve query params in reverse proxy
Fixes #2853

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5642056
2012-02-07 18:00:30 -08:00
Rob Pike
92f55949f9 encoding/hex: canonicalize error type names
Also simplify the tests.

Fixes #2849.

R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/5643045
2012-02-08 11:53:32 +11:00
Nigel Tao
5e381d3a9a image: delete the image.Repeated type.
R=r
CC=golang-dev
https://golang.org/cl/5636045
2012-02-08 11:41:47 +11:00
Rob Pike
2f8e5a5f88 io/ioutil: document EOF behavior in ReadFile and ReadAll
Fixes #2862.

R=golang-dev, n13m3y3r, iant
CC=golang-dev
https://golang.org/cl/5646048
2012-02-08 11:40:56 +11:00
Robert Griesemer
3d6b368514 go/printer, gofmt: don't print incorrect programs
Be careful when printing line comments with incorrect
position information. Maintain additional state
impliedSemi: when set, a comment containing a newline
would imply a semicolon and thus placement must be
delayed.

Precompute state information pertaining to the next
comment for faster checks (the printer is marginally
faster now despite additional checks for each comment).

No effect on existing src, misc sources.

Fixes #1505.

R=rsc
CC=golang-dev
https://golang.org/cl/5598054
2012-02-07 15:19:52 -08:00
Russ Cox
e3755434b8 5l, 6l, 8l: implement -X flag
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5643050
2012-02-07 16:46:33 -05:00
David Symonds
32ffc62348 flag: describe valid input for Duration flags.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5639046
2012-02-07 17:50:04 +11:00
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
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
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
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
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
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
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
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
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
ebd9f236de unicode: document large var blocks and the SpecialCase vars.
Fixes #2772.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5631047
2012-02-04 18:35:37 +11:00
Russ Cox
57b7bbe988 cmd/dist: fix memory bug (fix builders?)
Thanks, Valgrind!

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5630050
2012-02-04 02:15:53 -05:00
Russ Cox
a19ab9d1cc 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
2012-02-04 02:01:58 -05:00
Russ Cox
650e8de0a5 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
2012-02-04 01:46:46 -05:00
Russ Cox
68576506d6 cmd/dist: add BSD gohostos cases
Should fix FreeBSD build.

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5629050
2012-02-04 01:39:29 -05:00
Russ Cox
7e5dc928a4 path/filepath: disable broken tests
TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5625050
2012-02-04 01:37:30 -05:00
Russ Cox
b8b2253ac7 cmd/dist: fix build
TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5630049
2012-02-04 01:23:54 -05:00
Russ Cox
961f96b5d2 build: delete buildscripts, runtime scripts
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5620059
2012-02-04 00:54:26 -05:00
Russ Cox
8290536864 build: use cmd/dist
R=bradfitz, ality, r, r, iant, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5615058
2012-02-04 00:54:08 -05:00
Russ Cox
4c1abd6c64 build: dist-based build for windows
R=golang-dev, bradfitz, iant, alex.brainman, go.peter.90
CC=golang-dev
https://golang.org/cl/5630047
2012-02-04 00:48:31 -05:00
Mikio Hara
67b277c3b9 cmd/dist: fix build on openbsd
R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/5608060
2012-02-04 13:27:12 +09:00