cmd/compile: rewrite %1v and %2v formats to %S and %L (short and long)

- also consistently use %v instead of %s when we have a (gc) Formatter
- rewrite done automatically using Formats test in -u (update) mode
- manual update of format strings that were not single string constants
- updated fmt.go, fmt_test.go accordingly
- fmt_test: permit "%T" always

Change-Id: I8f0704286aba5704600ad0c4a4484005b79b905d
Reviewed-on: https://go-review.googlesource.com/28954
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Robert Griesemer 2016-09-09 21:08:46 -07:00
parent af8ca3387a
commit 6537e18f02
40 changed files with 206 additions and 209 deletions

View file

@ -48,7 +48,7 @@ func typecheckrange(n *Node) {
toomany = 0
switch t.Etype {
default:
Yyerror("cannot range over %2v", n.Right)
Yyerror("cannot range over %L", n.Right)
goto out
case TARRAY, TSLICE:
@ -104,7 +104,7 @@ func typecheckrange(n *Node) {
if v1.Name != nil && v1.Name.Defn == n {
v1.Type = t1
} else if v1.Type != nil && assignop(t1, v1.Type, &why) == 0 {
Yyerror("cannot assign type %v to %2v in range%s", t1, v1, why)
Yyerror("cannot assign type %v to %L in range%s", t1, v1, why)
}
checkassign(n, v1)
}
@ -113,7 +113,7 @@ func typecheckrange(n *Node) {
if v2.Name != nil && v2.Name.Defn == n {
v2.Type = t2
} else if v2.Type != nil && assignop(t2, v2.Type, &why) == 0 {
Yyerror("cannot assign type %v to %2v in range%s", t2, v2, why)
Yyerror("cannot assign type %v to %L in range%s", t2, v2, why)
}
checkassign(n, v2)
}