]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/vet: fix up some nits in print.go found by kamil.kisiel@gmail.com
authorRob Pike <r@golang.org>
Sun, 24 Feb 2013 21:18:36 +0000 (13:18 -0800)
committerRob Pike <r@golang.org>
Sun, 24 Feb 2013 21:18:36 +0000 (13:18 -0800)
R=golang-dev, kamil.kisiel, bradfitz
CC=golang-dev
https://golang.org/cl/7369049

src/cmd/vet/print.go

index b164a9b5884dd2442398771304afd8b0793659aa..fde440a05e21af3a0e8388c9ed1db31b1177075c 100644 (file)
@@ -415,8 +415,8 @@ func (f *File) numArgsInSignature(call *ast.CallExpr) int {
 }
 
 // isErrorMethodCall reports whether the call is of a method with signature
-//     func Error() error
-// where "error" is the universe's error type. We know the method is called "Error"
+//     func Error() string
+// where "string" is the universe's string type. We know the method is called "Error"
 // and f.pkg is set.
 func (f *File) isErrorMethodCall(call *ast.CallExpr) bool {
        // Is it a selector expression? Otherwise it's a function call, not a method call.
@@ -457,7 +457,7 @@ func (f *File) isErrorMethodCall(call *ast.CallExpr) bool {
        if types.IsIdentical(result, types.Typ[types.String]) {
                return true
        }
-       return true
+       return false
 }
 
 // Error methods that do not satisfy the Error interface and should be checked.