go.tools/cmd/vet: don't panic on zero arg Log method calls.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/134000043
This commit is contained in:
David Symonds 2014-08-29 08:56:35 +10:00
parent 4c3c0f68c5
commit 2b15aa63b7
1 changed files with 1 additions and 1 deletions

View File

@ -496,7 +496,7 @@ func (f *File) checkPrint(call *ast.CallExpr, name string, firstArg int) {
isLn := strings.HasSuffix(name, "ln")
isF := strings.HasPrefix(name, "F")
args := call.Args
if name == "Log" {
if name == "Log" && len(args) > 0 {
// Special case: Don't complain about math.Log or cmplx.Log.
// Not strictly necessary because the only complaint likely is for Log("%d")
// but it feels wrong to check that math.Log is a good print function.