mirror of
https://github.com/golang/go
synced 2024-11-12 02:40:21 -07:00
cmd/vet: fix up some nits in print.go found by kamil.kisiel@gmail.com
R=golang-dev, kamil.kisiel, bradfitz CC=golang-dev https://golang.org/cl/7369049
This commit is contained in:
parent
83e22f1a47
commit
1174a18c3d
@ -415,8 +415,8 @@ func (f *File) numArgsInSignature(call *ast.CallExpr) int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// isErrorMethodCall reports whether the call is of a method with signature
|
// isErrorMethodCall reports whether the call is of a method with signature
|
||||||
// func Error() error
|
// func Error() string
|
||||||
// where "error" is the universe's error type. We know the method is called "Error"
|
// where "string" is the universe's string type. We know the method is called "Error"
|
||||||
// and f.pkg is set.
|
// and f.pkg is set.
|
||||||
func (f *File) isErrorMethodCall(call *ast.CallExpr) bool {
|
func (f *File) isErrorMethodCall(call *ast.CallExpr) bool {
|
||||||
// Is it a selector expression? Otherwise it's a function call, not a method call.
|
// 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]) {
|
if types.IsIdentical(result, types.Typ[types.String]) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return true
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// Error methods that do not satisfy the Error interface and should be checked.
|
// Error methods that do not satisfy the Error interface and should be checked.
|
||||||
|
Loading…
Reference in New Issue
Block a user