1
0
mirror of https://github.com/golang/go synced 2024-11-23 06:10:05 -07:00

go/types: fix format errors

Found by pending CL to make cmd/vet auto-detect printf wrappers.

Change-Id: I1928a5bcd7885cdd950ce81b7d0ba07fbad3bf88
Reviewed-on: https://go-review.googlesource.com/109343
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Russ Cox 2018-04-25 16:02:58 -04:00
parent 9e0e6981fc
commit 932794cbf1
7 changed files with 10 additions and 10 deletions

View File

@ -623,7 +623,7 @@ func (check *Checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ b
// Note: trace is only available in self-test mode.
// (no argument evaluated yet)
if nargs == 0 {
check.dump("%s: trace() without arguments", call.Pos())
check.dump("%v: trace() without arguments", call.Pos())
x.mode = novalue
break
}
@ -631,7 +631,7 @@ func (check *Checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ b
x1 := x
for _, arg := range call.Args {
check.rawExpr(x1, arg, nil) // permit trace for types, e.g.: new(trace(T))
check.dump("%s: %s", x1.pos(), x1)
check.dump("%v: %s", x1.pos(), x1)
x1 = &t // use incoming x only for first argument
}
// trace is only available in test mode - no need to record signature

View File

@ -274,7 +274,7 @@ func (check *Checker) argument(fun ast.Expr, sig *Signature, i int, x *operand,
typ = sig.params.vars[n-1].typ
if debug {
if _, ok := typ.(*Slice); !ok {
check.dump("%s: expected unnamed slice type, got %s", sig.params.vars[n-1].Pos(), typ)
check.dump("%v: expected unnamed slice type, got %s", sig.params.vars[n-1].Pos(), typ)
}
}
default:
@ -448,7 +448,7 @@ func (check *Checker) selector(x *operand, e *ast.SelectorExpr) {
// lookup.
mset := NewMethodSet(typ)
if m := mset.Lookup(check.pkg, sel); m == nil || m.obj != obj {
check.dump("%s: (%s).%v -> %s", e.Pos(), typ, obj.name, m)
check.dump("%v: (%s).%v -> %s", e.Pos(), typ, obj.name, m)
check.dump("%s\n", mset)
panic("method sets and lookup don't agree")
}

View File

@ -249,7 +249,7 @@ func (check *Checker) recordUntyped() {
for x, info := range check.untyped {
if debug && isTyped(info.typ) {
check.dump("%s: %s (type %s) is typed", x.Pos(), x, info.typ)
check.dump("%v: %s (type %s) is typed", x.Pos(), x, info.typ)
unreachable()
}
check.recordTypeAndValue(x, info.mode, info.typ, info.val)

View File

@ -67,7 +67,7 @@ func (check *Checker) objDecl(obj Object, def *Named, path []*TypeName) {
d := check.objMap[obj]
if d == nil {
check.dump("%s: %s should have been declared", obj.Pos(), obj)
check.dump("%v: %s should have been declared", obj.Pos(), obj)
unreachable()
}

View File

@ -382,7 +382,7 @@ func (check *Checker) updateExprType(x ast.Expr, typ Type, final bool) {
// The respective sub-expressions got their final types
// upon assignment or use.
if debug {
check.dump("%s: found old type(%s): %s (new: %s)", x.Pos(), x, old.typ, typ)
check.dump("%v: found old type(%s): %s (new: %s)", x.Pos(), x, old.typ, typ)
unreachable()
}
return

View File

@ -144,7 +144,7 @@ func (check *Checker) infoFromTypeLit(scope *Scope, iface *ast.InterfaceType, tn
}
if trace {
check.trace(iface.Pos(), "-- collect methods for %s (path = %s)", iface, pathString(path))
check.trace(iface.Pos(), "-- collect methods for %v (path = %s)", iface, pathString(path))
check.indent++
defer func() {
check.indent--

View File

@ -487,7 +487,7 @@ func (check *Checker) interfaceType(ityp *Interface, iface *ast.InterfaceType, d
interfaceContext := check.context // capture for use in closure below
check.later(func() {
if trace {
check.trace(iface.Pos(), "-- delayed checking embedded interfaces of %s", iface)
check.trace(iface.Pos(), "-- delayed checking embedded interfaces of %v", iface)
check.indent++
defer func() {
check.indent--
@ -524,7 +524,7 @@ func (check *Checker) interfaceType(ityp *Interface, iface *ast.InterfaceType, d
// don't just assert, but report error since this
// used to be the underlying cause for issue #18395.
if embed.allMethods == nil {
check.dump("%s: incomplete embedded interface %s", f.Type.Pos(), typ)
check.dump("%v: incomplete embedded interface %s", f.Type.Pos(), typ)
unreachable()
}
// collect interface