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:
parent
4c3c0f68c5
commit
2b15aa63b7
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue