aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2023-09-08 12:21:47 +0200
committerAleksandr Nogikh <nogikh@google.com>2023-09-08 12:36:54 +0000
commit019310abd323b17b630725934bce3cd08ab6ea72 (patch)
tree91847b54cc52678a081420dbf96950b78f12413c
parent01e5df16502f8eb3719abb4169da1f369f6073d0 (diff)
pkg/bisect: validate log() arguments
I couldn't manage to add "pkg/bisect.env.log" to "govet"."settings"."printf"."funcs", so let's use another way suggested by govet documentation. Fix one instance of invalid arguments.
-rw-r--r--pkg/bisect/bisect.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/bisect/bisect.go b/pkg/bisect/bisect.go
index 8d83b0737..270668e05 100644
--- a/pkg/bisect/bisect.go
+++ b/pkg/bisect/bisect.go
@@ -519,7 +519,7 @@ func (env *env) commitRangeForCause() (*vcs.Commit, *vcs.Commit, []*testResult,
return nil, nil, nil, fmt.Errorf("no release tags before this commit")
}
pickedTags := pickReleaseTags(tags)
- env.log("picked %d out of %d release tags", pickedTags)
+ env.log("picked %v out of %d release tags", pickedTags, len(tags))
lastBad := env.commit
var results []*testResult
@@ -1035,6 +1035,9 @@ func checkConfig(cfg *Config) error {
}
func (env *env) log(msg string, args ...interface{}) {
+ if false {
+ _ = fmt.Sprintf(msg, args...) // enable printf checker
+ }
env.cfg.Trace.Log(msg, args...)
}