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

3635 Commits

Author SHA1 Message Date
Alex Brainman
3c4ca95da9 path/filepath: fixes for windows paths
- Clean and IsAbs to handle paths with drive letter properly.
- Clean to replace / with \.

R=golang-dev, adg
CC=golang-dev, mattn.jp
https://golang.org/cl/4758051
2011-07-18 17:08:12 +10:00
Nigel Tao
95323c59ea runtime: fix panic for make(chan [0]byte).
I suspect that this was introduced by
http://code.google.com/p/go/source/detail?r=6e4ee32fffd1

R=r
CC=golang-dev
https://golang.org/cl/4764045
2011-07-18 15:54:11 +10:00
David Symonds
a8e0035bd3 http: drain the pipe output in TestHandlerPanic to avoid logging deadlock.
R=r
CC=golang-dev
https://golang.org/cl/4756047
2011-07-18 12:59:16 +10:00
Rob Pike
08e47ebb7d fmt: fix a couple of documentation glitches.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4758050
2011-07-18 11:44:27 +10:00
Rob Pike
50d90451ff reflect: panic if Method index is out of range for a type.
Makes the code agree with the documentation.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4759050
2011-07-18 11:34:13 +10:00
Quan Yong Zhai
cb051a3a1d gob: minor cleanup
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4754050
2011-07-18 10:48:31 +10:00
Rob Pike
f189308fb4 fmt: Scan(&int) was mishandling a lone zero.
It took it as an octal base prefix but assumed more digits were coming.
Fixes #2077.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4764044
2011-07-18 10:05:35 +10:00
Brad Fitzpatrick
8b33c7b5be http: make tests quiet, fixing a test race
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4754044
2011-07-17 15:46:10 -07:00
Brad Fitzpatrick
6075206904 log: more locking
This didn't actually cause a bug, but looks wrong.

There was a lock but there was more shared mutable state not
guarded by it.

R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/4760047
2011-07-17 15:46:00 -07:00
Rob Pike
c705701c69 exp/templates: variable scope persists until "end".
The previous CL doicumented and diagnosed the old situation.
This one changes it to something more traditional: any action
may declare a variable, and the block structure of scopes
applies only to control seequences.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4748047
2011-07-17 13:31:59 +10:00
Rob Pike
331840f509 exp/template: allow declaration of variables only inside control structures.
In simple pipelines the declaration has no scope.
Also document the scope.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4761044
2011-07-17 12:32:00 +10:00
Russ Cox
e07c6e6ee7 http: fixes for sniffing
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4753044
2011-07-15 12:07:37 -04:00
Dmitriy Vyukov
491aa1579d runtime: native xadd for 386/amd64
benchmark                          old ns/op    new ns/op    delta
BenchmarkSemaUncontended               37.40        34.10   -8.82%
BenchmarkSemaUncontended-2             18.90        17.70   -6.35%
BenchmarkSemaUncontended-4             11.90        10.90   -8.40%
BenchmarkSemaUncontended-8              6.26         5.19  -17.09%
BenchmarkSemaUncontended-16             4.39         3.91  -10.93%
BenchmarkSemaSyntNonblock              38.00        35.30   -7.11%
BenchmarkSemaSyntNonblock-2            83.00        46.70  -43.73%
BenchmarkSemaSyntNonblock-4           124.00       101.00  -18.55%
BenchmarkSemaSyntNonblock-8           124.00       116.00   -6.45%
BenchmarkSemaSyntNonblock-16          148.00       114.00  -22.97%

(on HP Z600 2 x Xeon E5620, 8 HT cores, 2.40GHz)

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4755041
2011-07-15 11:27:16 -04:00
Russ Cox
e1b2e20217 http: sniffing placeholder
R=dsymonds
CC=golang-dev
https://golang.org/cl/4746041
2011-07-15 01:01:49 -04:00
Andrew Gerrand
5d929a9c92 go/build: less aggressive failure when GOROOT not found
R=golang-dev, rsc, dsymonds
CC=golang-dev
https://golang.org/cl/4743041
2011-07-15 13:45:22 +10:00
Russ Cox
29125be5c7 runtime: make TestSideEffectOrder work twice
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4714045
2011-07-14 23:43:03 -04:00
Brad Fitzpatrick
fc7b42325a cgi: make test less flaky
Previously, during the anti-zombie test, a
CGI process had to finish within ~625ms.
Now it gets ~5.6 seconds.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4741041
2011-07-14 17:00:14 -07:00
Robert Griesemer
48f598a393 go/printer: simplify internal state
No formatting changes.

R=rsc
CC=golang-dev
https://golang.org/cl/4735042
2011-07-14 16:09:15 -07:00
Robert Griesemer
90564a9256 go/printer: changed max. number of newlines from 3 to 2
manual changes in src/pkg/go/printer, src/cmd/gofix/signal_test.go
(cd src/cmd/gofix/testdata; gofmt -w *.in *.out)
(cd src/pkg/go/printer; gotest -update)
gofmt -w misc src

runs all tests

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4715041
2011-07-14 14:39:40 -07:00
Brad Fitzpatrick
3f53475c97 json: add omitempty struct tag option
Fixes #2032

R=rsc, dsymonds, r, r
CC=golang-dev
https://golang.org/cl/4709044
2011-07-14 11:54:55 -07:00
David Symonds
cbad580e9c json: escape < and > in any JSON string.
Angle brackets can trigger some browser sniffers, causing
some forms of JSON output to be interpreted as HTML.
Escaping angle brackets closes that security hole.

R=rsc
CC=golang-dev
https://golang.org/cl/4701047
2011-07-14 13:30:08 +10:00
Rob Pike
fc1f0bd5e9 exp/template: allow range actions to declare a key and element variable.
{{range $key, $element := pipeline}}
This CL is smaller than it looks due to some rearrangement and renaming.

R=rsc, r
CC=golang-dev
https://golang.org/cl/4709047
2011-07-14 13:15:55 +10:00
Russ Cox
aec89c4c40 mime: fix build
R=bradfitz
CC=golang-dev
https://golang.org/cl/4695060
2011-07-13 20:04:12 -07:00
David Symonds
a16ad6fe0f exp/template: escape < and > in JS escaper.
Angle brackets can trigger some browser sniffers,
causing some output to be interpreted as HTML.
Escaping angle brackets closes that security hole.

R=r
CC=golang-dev
https://golang.org/cl/4714044
2011-07-14 12:02:58 +10:00
Rob Pike
dfffc7a5d5 exp/template: include function name in error returned by function or method call.
R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/4711049
2011-07-14 11:32:06 +10:00
Rob Pike
19e207d24d exp/template: simplify method and function calls by using the value's Method
rather than the type's, so a method's invocation works the same as a function's.

R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/4704049
2011-07-14 11:00:23 +10:00
Mikio Hara
689a2ec8c3 json: allow using '$' and '-' as the struct field's tag
R=adg, rsc, bradfitz, mattn.jp, gustavo
CC=golang-dev
https://golang.org/cl/4625081
2011-07-13 17:41:33 -07:00
Rob Pike
125e8277d5 reflect: trivial addition: Value.NumMethod.
Just an oversight it was missing.

R=rsc, dsymonds, bradfitz, r
CC=golang-dev
https://golang.org/cl/4695059
2011-07-14 10:38:15 +10:00
Yuval Pavel Zholkover
0bf36ce8fb os: Plan 9: add Process.Signal as a way to send notes.
Move the Signal interface from exec_posix.go to exec.go.
Remove some unsused code from file_plan9.go.

R=fshahriar, rsc
CC=golang-dev
https://golang.org/cl/4683044
2011-07-13 16:29:37 -07:00
Alex Brainman
dde435587d runtime: correct FixedStack value (fixes windows build)
Fixes #2068.

R=rsc
CC=golang-dev
https://golang.org/cl/4705046
2011-07-14 09:13:39 +10:00
Brad Fitzpatrick
8ba48fb5ca fix build from e904b6784768 breakage
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4696047
2011-07-13 15:48:57 -07:00
Russ Cox
aebfd63cd9 syscall: add Flock on Linux
Fixes #2069.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4703048
2011-07-13 15:34:36 -07:00
Russ Cox
a16baf0777 syscall: change missing from windows net fixes
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4701045
2011-07-13 15:34:21 -07:00
Robert Griesemer
f4acaa8ecd filepath/path: fix a comment
R=bradfitz
CC=golang-dev
https://golang.org/cl/4704047
2011-07-13 15:10:50 -07:00
Rob Pike
469e333106 exp/template: tweak behavior of booleans.
Russ suggested this technique, making the "and" and "or" functions handier.
But it's hacky, and I can be talked out of it.

R=dsymonds, rsc
CC=golang-dev
https://golang.org/cl/4698044
2011-07-14 07:59:04 +10:00
Rob Pike
c3344d61bd exp/template: allow niladic methods inside chained field references.
Also really fix the bug about dot vs. receivers.

R=rsc, r
CC=golang-dev
https://golang.org/cl/4705047
2011-07-14 07:52:07 +10:00
Yasuhiro Matsumoto
2012290c7e http: fix Content-Type of file extension.
ServeFile() pass empty string to serveFile(). serveFile() should get
file extension via joining root and filename.

R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/4654089
2011-07-13 14:39:33 -07:00
Wei Guangjing
350504559e net: windows/amd64 port
R=rsc, alex.brainman
CC=golang-dev
https://golang.org/cl/3790044
2011-07-13 12:44:21 -07:00
Matthew Horsnell
932db13e93 debug/elf: Read ELF Program headers.
NewFile has been fixed to read ELF Program headers into the structs.
Added test coverage.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4628062
2011-07-13 12:34:29 -07:00
Wei Guangjing
a6e60916c1 runtime: stdcall_raw stack 16byte align for Win64
R=alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/4681049
2011-07-13 11:44:44 -07:00
Dmitriy Vyukov
86a659cad0 runtime: fix data race during Itab hash update/lookup
The data race is on newly published Itab nodes, which are
both unsafely published and unsafely acquired. It can
break on IA-32/Intel64 due to compiler optimizations
(most likely not an issue as of now) and on ARM due to
hardware memory access reorderings.

R=rsc
CC=golang-dev
https://golang.org/cl/4673055
2011-07-13 11:22:41 -07:00
Brad Fitzpatrick
dcdaeebdfb docs: fix wrong it's -> its
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/4702046
2011-07-13 10:54:51 -07:00
Sam Thorogood
e3a773479d exp/regexp/syntax: add Prog.NumCap
R=rsc, r
CC=golang-dev
https://golang.org/cl/4662083
2011-07-13 10:15:00 -07:00
Robert Griesemer
4c986d86b1 exp/eval, exp/ogle: remove packages eval and ogle
An externally maintained version of exp/eval can
be found at: https://bitbucket.org/binet/go-eval/ .

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/4695047
2011-07-13 09:40:53 -07:00
Bobby Powers
050d839df0 gob: register more slice types
Without explicitly registering slice types, gob fails to encode
map[string]interface{} instances where the value is a slice,
failing with a message such as:

  gob: type not registered for interface: []string

Fixes #2065.

R=golang-dev, gri, r
CC=golang-dev
https://golang.org/cl/4672056
2011-07-13 17:12:17 +10:00
Nigel Tao
d360e0213d html: update section references in comments to the latest HTML5 spec.
R=r
CC=golang-dev
https://golang.org/cl/4699048
2011-07-13 16:53:02 +10:00
Rob Pike
7aa1a1a64d exp/template: doc and API changes suggested by rsc.
- template invocation is by string constant only.
- NewSet is gone.
- no global Funcs
- writer is now first arg to Execute

R=rsc, r
CC=golang-dev
https://golang.org/cl/4700043
2011-07-13 15:58:31 +10:00
Rob Pike
2e9388e321 exp/template: add Set.AddSet and Set.Union.
Document and test that Set.Parse can be called multiple times.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4703044
2011-07-13 13:50:05 +10:00
Rob Pike
41efecf51c exp/template: allow variables as template names.
Just an oversight it wasn't already there.
Thanks to islandberry@live.com for pointing out the omission.

R=golang-dev, dsymonds
CC=golang-dev, islandberry
https://golang.org/cl/4703043
2011-07-13 13:21:18 +10:00
Robert Griesemer
75780f99f4 csv: fix spelling errors in comments
Fixes #2066.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4699045
2011-07-12 17:45:29 -07:00