Rob Pike
b8c664297b
exp/template: parse variables and declarations
...
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4631099
2011-07-08 17:54:16 +10:00
Rob Pike
ee14989e43
exp/template: lex variables
...
Variables start with'$' and are declared with ':='.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4662084
2011-07-08 17:53:55 +10:00
Rob Pike
02039b6345
exp/template: add a tree-walking example to the test.
...
Also fix a comment formatting glitch.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4672054
2011-07-08 16:49:06 +10:00
Andrew Gerrand
ad58dc9d26
exp/template: the must-have MustParse functions
...
R=r
CC=golang-dev
https://golang.org/cl/4641096
2011-07-08 16:01:32 +10:00
Rob Pike
a852981d17
exp/template: allow fields and methods to be found in parent structs.
...
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4657085
2011-07-08 15:22:05 +10:00
Andrew Gerrand
5bcbcab311
sort: rename helpers: s/Sort// in sort.Sort[Float64s|Ints|Strings]
...
Includes 'sorthelpers' gofix and updates to tree.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4631098
2011-07-08 10:52:50 +10:00
David Symonds
e67a2504a1
gob: export fields in structs in the package documentation.
...
R=r
CC=golang-dev
https://golang.org/cl/4648075
2011-07-08 10:51:56 +10:00
Brad Fitzpatrick
3236097ab0
cgi: don't depend on CGI.pm for tests
...
CGI.pm used to be part of the Perl core,
but some distros now bundle perl-core
and perl-modules separately.
It's not worth depending on.
R=golang-dev, mattn.jp
CC=golang-dev
https://golang.org/cl/4675063
2011-07-07 17:45:28 -07:00
Nigel Tao
b39afde805
image/draw: add draw tests where the destination image doesn't start
...
at (0, 0).
Also refactor the test to use the SubImage method rather than monkeying
with an image's Pix and Rect fields.
R=r
CC=golang-dev
https://golang.org/cl/4678045
2011-07-08 09:54:21 +10:00
Adam Langley
d1d466f620
crypto/x509: prevent chain cycles in Verify
...
It's possible to include a self-signed root certificate as an
intermediate and push Verify into a loop.
I already had a test for this so I thought that it was ok, but it
turns out that the test was void because the Verisign root certificate
doesn't contain the "IsCA" flag and so it wasn't an acceptable
intermediate certificate for that reason.
R=bradfitz
CC=golang-dev
https://golang.org/cl/4657080
2011-07-07 18:06:50 -04:00
Nigel Tao
03f987c8ea
image: tighten Paletted.Opaque to check only those palette entries
...
in the image, not all palette entries.
R=r
CC=golang-dev
https://golang.org/cl/4672049
2011-07-07 16:32:19 +10:00
Rob Pike
07c9a92564
os: fix documentation for FileInfo.Name.
...
It's the base name, not the full name.
Fixes #2047 .
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4680041
2011-07-07 16:05:38 +10:00
Rob Pike
238274ede0
exp/template: handle pointers and values in empty interfaces.
...
R=golang-dev, r, mattn.jp
CC=golang-dev
https://golang.org/cl/4664064
2011-07-07 14:51:35 +10:00
Rob Pike
8d538c6d3d
exp/template: change the name from 'metacharacter' to 'delimiter',
...
because that's what they are.
No semantic change.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4675060
2011-07-07 10:56:33 +10:00
Gideon Jan-Wessel Redelinghuys
582d6e5848
crypto/openpgp: fixed dangerous use of for loop variable
...
In function readSignedMessage a pointer to for loop variable 'key' was incorrectly being assigned
to md.SignedBy. Changed so that md.SignedBy is pointing to the 'more correct' memory position.
R=golang-dev, r, agl
CC=golang-dev
https://golang.org/cl/4631088
2011-07-07 10:49:03 +10:00
Alex Brainman
e71fc0c1fe
syscall: rearrange windows code so 386 and amd64 can share files
...
R=golang-dev, r
CC=golang-dev, vcc.163
https://golang.org/cl/4641093
2011-07-07 10:40:45 +10:00
Rob Pike
46ecd6f141
exp/template: index: forgot the always last-to-arrive uintptr.
...
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4636087
2011-07-07 07:00:48 +10:00
Adam Langley
1aa571d38b
asn1: support T61 and UTF8 string.
...
There is no end to the kitchen sink of string types in ASN.1.
Fixes #1953 .
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4672045
2011-07-06 16:25:44 -04:00
Adam Langley
502589e030
crypto/tls: fix generate_cert.go
...
Fixes #2030 .
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4635092
2011-07-06 16:22:21 -04:00
Ian Lance Taylor
7b0bb48056
json: fix test if rand returns 0.
...
Fixes test when run with gccgo using optimization, which
changes the order of the calls to rand.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4639101
2011-07-06 13:00:54 -07:00
Rob Pike
6732bd3526
exp/template: index function for arrays, slices, and maps.
...
R=golang-dev, adg, r
CC=golang-dev
https://golang.org/cl/4643072
2011-07-06 22:27:06 +10:00
Rob Pike
64228e36a4
exp/template: silence test noise (but add a flag to put it back)
...
Also delete a TODO and clean up a little evaluation code.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4643071
2011-07-06 17:46:36 +10:00
David Symonds
33705ddea1
exp/template: add a JavaScript escaper.
...
R=r
CC=golang-dev
https://golang.org/cl/4671048
2011-07-06 16:51:49 +10:00
Rob Pike
a33cc423b4
exp/template: allow an empty interface value to be the target of range, etc.
...
We extract the concrete value inside.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4677041
2011-07-06 16:40:46 +10:00
Rob Pike
381a555f40
exp/template: improve error message for non-exported field.
...
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4636086
2011-07-06 15:56:39 +10:00
Rob Pike
a8e5db9449
maketables: update debugging data.
...
This is unused in the generation of the tables, but was incorrect if we ever needed it.
Also update the reference to the document.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4626097
2011-07-06 15:35:23 +10:00
David Symonds
9d5ed1744a
exp/template: add missing dotNode case.
...
R=r
CC=golang-dev
https://golang.org/cl/4672044
2011-07-06 15:14:10 +10:00
Rob Pike
9495dd31d2
exp/template: fixes and updates.
...
- fix line numbers - forgot to update state.line during execution
- add a comment convention {{/* comment */}}
- set.Template returns the named template in the set
- set.Execute executes the named template in the set
- use a local methodByName so this package can be used with earlier release of reflect.
- use initial cap to detect exported names
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4668054
2011-07-06 14:46:41 +10:00
David Symonds
d45ba2c146
exp/template: remove debugging dreg.
...
R=r, gri
TBR=r
CC=golang-dev
https://golang.org/cl/4671047
2011-07-06 14:18:46 +10:00
Yasuhiro Matsumoto
1e6d946594
html: parse start tags that aren't explicitly otherwise dealt with.
...
R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/4626080
2011-07-06 13:08:52 +10:00
Rob Pike
329990d525
exp/template: remove the need for a goroutine.
...
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4626095
2011-07-06 11:02:53 +10:00
Rob Pike
4657d7d7db
exp/template: remove the visibility of the token channel from the parser.
...
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4675053
2011-07-06 10:13:53 +10:00
Rob Pike
eea5443572
exp/template: add templates to sets; boolean logic.
...
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4670045
2011-07-05 17:05:15 +10:00
Rob Pike
5b1658232e
exp/template: statically check that functions names have been defined.
...
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4675046
2011-07-05 16:02:34 +10:00
Fazlul Shahriar
bedee318d5
os: fix build for Plan 9
...
R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/4657074
2011-07-05 16:01:29 +10:00
Rob Pike
cc9fed7c1a
exp/template: add an html escaping function.
...
R=golang-dev, dsymonds, adg
CC=golang-dev
https://golang.org/cl/4626092
2011-07-05 15:58:54 +10:00
Nigel Tao
104f57ad39
image: add a test for filling sub-images.
...
R=r
CC=golang-dev
https://golang.org/cl/4626091
2011-07-05 14:42:31 +10:00
Rob Pike
b177c97803
exp/template: functions
...
Add the ability to attach functions to template and template sets.
Make variadic functions and methods work.
Still to come: static checking of function names during parse.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4643068
2011-07-05 14:23:51 +10:00
Rob Pike
13f889778e
exp/template: add template sets, allowing templates to reference one another
...
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4673042
2011-07-04 15:15:47 +10:00
Rob Pike
72efdea20e
exp/template: allow complex numbers, add 'with', 'define', and 'template' keywords.
...
Also simplify the handling of keywords.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4639096
2011-07-04 11:50:35 +10:00
Rob Pike
db0e358022
reflect: allow Len on String values.
...
It's probably just an oversight that it doesn't work,
perhaps caused by analogy with Cap.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4634125
2011-07-04 11:45:31 +10:00
Andrew Gerrand
8c7a73bbbb
go/build: evaluate symlinks before comparing path to GOPATH
...
R=golang-dev, r, dsymonds
CC=golang-dev
https://golang.org/cl/4645078
2011-07-04 10:26:03 +10:00
Adam Langley
acc284d847
crypto/openpgp: add ability to reserialize keys.
...
This changes Signature so that parsed signatures can be reserialized
exactly. With this ability we can add Serialize to Entity and also the
ability to sign other public keys.
R=bradfitz
CC=golang-dev
https://golang.org/cl/4627084
2011-07-01 13:53:12 -04:00
Paul Borman
00f7cd4b36
csv: new package
...
csv reader/writer based on RFC 4180
R=rsc, mattn.jp, r, dchest
CC=golang-dev
https://golang.org/cl/4629085
2011-07-01 12:16:56 -04:00
Wei Guangjing
63b8b948d9
windows: define and use syscall.Handle
...
Fixes #1487 .
R=rsc, alex.brainman, go.peter.90, mikioh.mikioh, mattn.jp
CC=golang-dev
https://golang.org/cl/4600042
2011-07-01 10:18:07 -04:00
Brad Fitzpatrick
3aa8272e44
fix build; add simplify.go to regexp Makefile
...
R=rsc
CC=golang-dev
https://golang.org/cl/4643062
2011-06-30 10:45:36 -07:00
Yasuhiro Matsumoto
2f9fbad043
http/cgi: add Handler.Dir to specify working directory
...
R=golang-dev, bradfitz, alex.brainman
CC=golang-dev
https://golang.org/cl/4635042
2011-06-30 09:44:23 -07:00
Dmitriy Vyukov
dd2074c82a
sync: improve Mutex to allow successive acquisitions
...
This implementation allows a goroutine to do successive acquisitions
of a mutex even if there are blocked goroutines.
Moreover, it allows a newcomer goroutine to acquire a mutex ahead of
blocked goroutines (that is, it does not enforce FIFO).
On implementation level it's achieved by separating waiter count and
locked flag.
Benchmark results on HP Z600 (2 x Xeon E5620, 8 HT cores, 2.40GHz)
are as follows (with 4631059 "replace Semacquire/Semrelease implementation"
patch applied):
benchmark old ns/op new ns/op delta
sync_test.BenchmarkMutexUncontended 24.10 25.40 +5.39%
sync_test.BenchmarkMutexUncontended-2 12.00 13.00 +8.33%
sync_test.BenchmarkMutexUncontended-4 6.06 6.83 +12.71%
sync_test.BenchmarkMutexUncontended-8 3.63 3.60 -0.83%
sync_test.BenchmarkMutexUncontended-16 2.38 2.49 +4.62%
sync_test.BenchmarkMutex 25.00 26.40 +5.60%
sync_test.BenchmarkMutex-2 231.00 49.00 -78.79%
sync_test.BenchmarkMutex-4 259.00 114.00 -55.98%
sync_test.BenchmarkMutex-8 641.00 110.00 -82.84%
sync_test.BenchmarkMutex-16 1380.00 96.30 -93.02%
sync_test.BenchmarkMutexSlack 24.80 26.20 +5.65%
sync_test.BenchmarkMutexSlack-2 210.00 106.00 -49.52%
sync_test.BenchmarkMutexSlack-4 453.00 119.00 -73.73%
sync_test.BenchmarkMutexSlack-8 1024.00 105.00 -89.75%
sync_test.BenchmarkMutexSlack-16 1291.00 91.90 -92.88%
sync_test.BenchmarkMutexWork 796.00 796.00 +0.00%
sync_test.BenchmarkMutexWork-2 399.00 401.00 +0.50%
sync_test.BenchmarkMutexWork-4 216.00 212.00 -1.85%
sync_test.BenchmarkMutexWork-8 1547.00 196.00 -87.33%
sync_test.BenchmarkMutexWork-16 2754.00 287.00 -89.58%
sync_test.BenchmarkMutexWorkSlack 792.00 800.00 +1.01%
sync_test.BenchmarkMutexWorkSlack-2 430.00 420.00 -2.33%
sync_test.BenchmarkMutexWorkSlack-4 467.00 230.00 -50.75%
sync_test.BenchmarkMutexWorkSlack-8 1860.00 273.00 -85.32%
sync_test.BenchmarkMutexWorkSlack-16 3029.00 294.00 -90.29%
R=rsc
CC=golang-dev
https://golang.org/cl/4631075
2011-06-30 11:13:29 -04:00
Russ Cox
b4cae4aee2
exp/regexp/syntax: finish Regexp manipulation
...
Except for the inevitable bug fixes, the Regexp code is done.
R=sam.thorogood, r
CC=golang-dev
https://golang.org/cl/4635082
2011-06-30 10:26:22 -04:00
Russ Cox
a809abafa5
govet: automate test
...
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4629084
2011-06-30 10:26:11 -04:00