Skip to content

Commit 2bc6eae

Browse files
committed
addtags: Fix go vet errors
With newer go versions, `go vet` reports: ``` cmd/addtags/main.go:19:25: non-constant format string in call to fmt.Fprintf cmd/addtags/main.go:24:25: non-constant format string in call to fmt.Fprintf ``` This happens because of the use of [1:] to remove an unwanted `\n` at the beginning of the string. This commit switches to `Fprint` instead of `Fprintf` as there are no substitutions to be made in the string. Signed-off-by: Christophe Fergeau <[email protected]>
1 parent 8bf7ba5 commit 2bc6eae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd/addtags/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ var (
1616
)
1717

1818
func usage() {
19-
fmt.Fprintf(os.Stderr, `
19+
fmt.Fprint(os.Stderr, `
2020
usage: addtags -tags <build tags to apply> -file FILE <subcommand args...>
2121
`[1:])
2222

2323
flag.PrintDefaults()
24-
fmt.Fprintf(os.Stderr, `
24+
fmt.Fprint(os.Stderr, `
2525
It is intended for use with 'go generate', so it also runs a subcommand,
2626
which presumably creates the file.
2727
Sample usage:

0 commit comments

Comments
 (0)