From 29e82b56d92429a9ee02a612a70638ef8d91d63b Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Thu, 15 Nov 2018 09:29:40 -0500 Subject: [PATCH] go/analysis/passes/printf: actually use doc constant Change-Id: If33697d77a86e4b29089f3a1ba096477a34062be Reviewed-on: https://go-review.googlesource.com/c/149740 Run-TryBot: Alan Donovan TryBot-Result: Gobot Gobot Reviewed-by: Michael Matloob --- go/analysis/passes/printf/printf.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/go/analysis/passes/printf/printf.go b/go/analysis/passes/printf/printf.go index 4b761e25..80db95c8 100644 --- a/go/analysis/passes/printf/printf.go +++ b/go/analysis/passes/printf/printf.go @@ -32,7 +32,7 @@ func init() { var Analyzer = &analysis.Analyzer{ Name: "printf", - Doc: "check printf-like invocations", + Doc: doc, Requires: []*analysis.Analyzer{inspect.Analyzer}, Run: run, FactTypes: []analysis.Fact{new(isWrapper)}, @@ -43,12 +43,12 @@ const doc = `check consistency of Printf format strings and arguments The check applies to known functions (for example, those in package fmt) as well as any detected wrappers of known functions. -A function that wants to avail itself of printf checking but does not -get found by this analyzer's heuristics (for example, due to use of +A function that wants to avail itself of printf checking but is not +found by this analyzer's heuristics (for example, due to use of dynamic calls) can insert a bogus call: if false { - fmt.Sprintf(format, args...) // enable printf checking + _ = fmt.Sprintf(format, args...) // enable printf checking } The -funcs flag specifies a comma-separated list of names of additional