Skip to content

Commit a0f4ddd

Browse files
committed
fix govet
Signed-off-by: Mark Sagi-Kazar <[email protected]>
1 parent f48cbd1 commit a0f4ddd

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

flag_test.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ func testParseWithUnknownFlags(f *FlagSet, t *testing.T) {
433433
"-u=unknown3Value",
434434
"-p",
435435
"unknown4Value",
436-
"-q", //another unknown with bool value
436+
"-q", // another unknown with bool value
437437
"-y",
438438
"ee",
439439
"--unknown7=unknown7value",
@@ -899,7 +899,7 @@ func TestChangingArgs(t *testing.T) {
899899

900900
// Test that -help invokes the usage message and returns ErrHelp.
901901
func TestHelp(t *testing.T) {
902-
var helpCalled = false
902+
helpCalled := false
903903
fs := NewFlagSet("help test", ContinueOnError)
904904
fs.Usage = func() { helpCalled = true }
905905
var flag bool
@@ -998,6 +998,7 @@ func getDeprecatedFlagSet() *FlagSet {
998998
f.MarkDeprecated("badflag", "use --good-flag instead")
999999
return f
10001000
}
1001+
10011002
func TestDeprecatedFlagInDocs(t *testing.T) {
10021003
f := getDeprecatedFlagSet()
10031004

@@ -1134,7 +1135,6 @@ func TestMultipleNormalizeFlagNameInvocations(t *testing.T) {
11341135
}
11351136
}
11361137

1137-
//
11381138
func TestHiddenFlagInUsage(t *testing.T) {
11391139
f := NewFlagSet("bob", ContinueOnError)
11401140
f.Bool("secretFlag", true, "shhh")
@@ -1149,7 +1149,6 @@ func TestHiddenFlagInUsage(t *testing.T) {
11491149
}
11501150
}
11511151

1152-
//
11531152
func TestHiddenFlagUsage(t *testing.T) {
11541153
f := NewFlagSet("bob", ContinueOnError)
11551154
f.Bool("secretFlag", true, "shhh")
@@ -1239,7 +1238,7 @@ func TestPrintDefaults(t *testing.T) {
12391238
got := buf.String()
12401239
if got != defaultOutput {
12411240
fmt.Println("\n" + got)
1242-
fmt.Println("\n" + defaultOutput)
1241+
fmt.Printf("\n" + defaultOutput)
12431242
t.Errorf("got %q want %q\n", got, defaultOutput)
12441243
}
12451244
}

0 commit comments

Comments
 (0)