]> Cypherpunks repositories - gostls13.git/commitdiff
govet: fix bug introduced at 4313054
authorRob Pike <r@golang.org>
Tue, 29 Mar 2011 20:18:52 +0000 (13:18 -0700)
committerRob Pike <r@golang.org>
Tue, 29 Mar 2011 20:18:52 +0000 (13:18 -0700)
R=rsc, gri
CC=golang-dev
https://golang.org/cl/4336042

src/cmd/govet/govet.go

index c9b0a9db37eb08116719bd7545e85e4baca9c379..c112844162b92fe392c1f9deb94f1475a28d1b6f 100644 (file)
@@ -256,7 +256,7 @@ func (f *File) checkPrintf(call *ast.CallExpr, name string, skip int) {
                return
        }
        if lit.Kind == token.STRING {
-               if strings.Contains(lit.Value, "%") {
+               if !strings.Contains(lit.Value, "%") {
                        if len(call.Args) > skip+1 {
                                f.Badf(call.Pos(), "no formatting directive in %s call", name)
                        }