This mostly adds Expect 100-continue tests (from
the perspective of server correctness) that were
missing before.
It also fixes a few missing cases that will
probably never come up in practice, but it's nice
to have handled correctly.
Proper 100-continue client support remains a TODO.
R=rsc, bradfitzwork
CC=golang-dev
https://golang.org/cl/4399044
- replaced existing testdata/test.sh with new gofmt_test
- added initial test case for rewrite tests
TODO: Need to add more tests.
R=rsc
CC=golang-dev
https://golang.org/cl/4368063
This CL is only cut-and-paste, moving code around.
Moving it in a separate CL should simplify the diffs in later CLs.
There are three patterns here.
1. A function like
func (v Value) M() (...) {
return v.panicIfNot(K).(*kValue).M()
}
becomes
func (v Value) M() (...) {
vv := v.panicIfNot(K).(*kValue)
// body of (*kValue).M, s/v./vv./g
}
2. A function like
func (v Value) M() (...) {
return v.panicIfNots(kList).(mer).M()
}
becomes
func (v Value) M() (...) {
switch vv := v.panicIfNots(kList).(type) {
case *k1Value:
// body of (*k1Value).M, s/v./vv./g
case *k2Value:
// body of (*k2Value).M, s/v./vv./g
...
}
panic("not reached")
}
3. The rewrite of Value.Set follows 2, but each case
is built from the bodies of (*kValue).SetValue and (*kValue).Set.
func (v *kValue) SetValue(x Value) {
v.Set(x.panicIfNot(K).(*kValue)
}
func (v *kValue) Set(x *kValue) {
... body
}
becomes, in the switch from 2,
case *kValue:
xx := x.panicIfNot(K).(*kValue)
... body, s/v./vv./g; s/x./xx./g
R=r
CC=golang-dev
https://golang.org/cl/4398044
This CL changes the behavior of 'make install' and 'make test'
in the src/cmd directory and the src/pkg directory to have
each recursive make clean up after itself immediately.
It does the same in test/run, removing $F.$A and $A.out
(the common byproducts) between runs.
On machines with slow disks and aggressive kernel caching,
cleaning up immediately can mean that the intermediate
objects never get written to disk.
This change eliminates almost all the disk waiting during
all.bash on my laptop (a Thinkpad X201s with an SSD running Linux).
147.50u 19.95s 277.34r before
148.53u 21.64s 179.59r after
R=golang-dev, r, iant2
CC=golang-dev
https://golang.org/cl/4413042
It matches encoding/line exactly and the tests are copied from there.
If we land this, then encoding/line will get marked as deprecated then
deleted in time.
R=rsc, rog, peterGo
CC=golang-dev
https://golang.org/cl/4389046
With the (partial) resolution of identifiers done
by the go/parser, ast.Objects point may introduce
cycles in the AST. Don't follow *ast.Objects, and
replace them with nil instead (they are likely
incorrect after a rewrite anyway).
- minor manual cleanups after reflect change automatic rewrite
- includes fix by rsc related to reflect change
Fixes#1667.
R=rsc
CC=golang-dev
https://golang.org/cl/4387044
Fmt command filters the current Go buffer through gofmt.
It tries to preserve cursor position and avoids replacing
the buffer with stderr output.
R=golang-dev, dsymonds, niemeyer
CC=golang-dev
https://golang.org/cl/4382053
The changes were not tested for real in an App Engine environment,
so extra care should be taken. That said, some static testing
was done with pyflakes, and a few existent problems were fixed on
the way.
R=adg
CC=golang-dev
https://golang.org/cl/4378053
The ld time was dominated by symbol table processing, so
* increase hash table size
* emit fewer symbols in gc (just 1 per string, 1 per type)
* add read-only lookup to avoid creating spurious symbols
* add linked list to speed whole-table traversals
Breaks dwarf generator (no idea why), so disable dwarf.
Reduces time for 6l to link godoc by 25%.
R=ken2
CC=golang-dev
https://golang.org/cl/4383047
Note that declarations.golden is not using spaces for alignment (so
that the alignment tabs are visible) which is why this change affects
the test cases significantly. gofmt uses spaces for alignment (by default)
and only tabs for indentation.
gofmt -w src misc (no changes)
Fixes#1673.
R=iant
CC=golang-dev
https://golang.org/cl/4388044
In the current codereview, if a patch was written against
a version of a file that had subsequently been edited,
hg clpatch would fail, even if the patch and the edits were
in different parts of the file. In this situation the reviewer
typically wrote back saying "please hg sync and hg mail
to update the patch".
This change rewrites the patch automatically, using the
same transformation that hg sync + hg mail would.
If the interim changes (since the patch was created)
affect the same line ranges as the patch, clpatch will
still refuse to apply it. But this CL should make
of the trivial conflicts we see just go away.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4377046
* add -diff command line option
* use scoping information in refersTo, isPkgDot, isPtrPkgDot.
* add new scoping-based helpers countUses, rewriteUses, assignsTo, isTopName.
* rename rewrite to walk, add walkBeforeAfter.
* add toy typechecker, a placeholder for go/types
R=gri
CC=golang-dev
https://golang.org/cl/4285053