mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.regabi] cmd/compile: rewrite stale format strings
On ir.Node, ir.Nodes, and ir.Op, # is ignored, so %#v is %v. On ir.Node, %S is the same as %v. On types.Type, # is ignored, so %#L is %L, %#v is %v. On types.Type, 0 is ignored, so %0S is %S. Rewrite all these using go test cmd/compile -r, plus a few multiline formats mentioning %0S on types updated by hand. Now the formats used in the compiler match the documentation for the format methods, a minor miracle. Passes buildall w/ toolstash -cmp. Change-Id: I3d4a3fae543145a68da13eede91166632c5b1ceb Reviewed-on: https://go-review.googlesource.com/c/go/+/275782 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
61889ba680
commit
724374f859
11 changed files with 29 additions and 42 deletions
|
|
@ -145,11 +145,11 @@ func TestCmpstackvar(t *testing.T) {
|
|||
for _, d := range testdata {
|
||||
got := cmpstackvarlt(d.a, d.b)
|
||||
if got != d.lt {
|
||||
t.Errorf("want %#v < %#v", d.a, d.b)
|
||||
t.Errorf("want %v < %v", d.a, d.b)
|
||||
}
|
||||
// If we expect a < b to be true, check that b < a is false.
|
||||
if d.lt && cmpstackvarlt(d.b, d.a) {
|
||||
t.Errorf("unexpected %#v < %#v", d.b, d.a)
|
||||
t.Errorf("unexpected %v < %v", d.b, d.a)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue