]> Cypherpunks repositories - gostls13.git/commitdiff
go/types: fix format errors
authorRuss Cox <rsc@golang.org>
Wed, 25 Apr 2018 20:02:58 +0000 (16:02 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 25 Apr 2018 20:22:06 +0000 (20:22 +0000)
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>

src/go/types/builtins.go
src/go/types/call.go
src/go/types/check.go
src/go/types/decl.go
src/go/types/expr.go
src/go/types/interfaces.go
src/go/types/typexpr.go

index 785daec331a0942b6f36c7363d59d3b8992f782d..afe5f5d0fcb448d94bda61519309954cca10722f 100644 (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
index ba9e45f7afc372efe8e897d6eb6e40ce28b4714e..1b40651b73479eefe62c46bbb91ad0e91714c283 100644 (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")
                                }
index d1b7155cf594e89fc0f170504637b15c68816717..177065fded54e60f7912ec0581013a2b42f79de4 100644 (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)
index 8278fab2adfc2a4a3943f830ae51042501a579a7..288ba8e447916170f18d0a84fdc67100cfa7fce0 100644 (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()
        }
 
index 04d6b72bc21f7320de50db1802245f8d9238b542..0a2a811bd88986684f795c04f297eef0cd76e6b8 100644 (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
index 1ce5e1ed976dfa0d763aba8e9478ba1d69f793cb..b4efebae5d059133d7bf6c2f07048be46d6baa42 100644 (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--
index 18234cb19d0ca79fc10bdef2f649f2a395df177c..5e48edef706779ac191cc20b37183178e04994a5 100644 (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