Skip to content

Commit

Permalink
fix govet
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Sagi-Kazar <[email protected]>
  • Loading branch information
sagikazarmark committed Jan 9, 2025
1 parent f48cbd1 commit a0f4ddd
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions flag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ func testParseWithUnknownFlags(f *FlagSet, t *testing.T) {
"-u=unknown3Value",
"-p",
"unknown4Value",
"-q", //another unknown with bool value
"-q", // another unknown with bool value
"-y",
"ee",
"--unknown7=unknown7value",
Expand Down Expand Up @@ -899,7 +899,7 @@ func TestChangingArgs(t *testing.T) {

// Test that -help invokes the usage message and returns ErrHelp.
func TestHelp(t *testing.T) {
var helpCalled = false
helpCalled := false
fs := NewFlagSet("help test", ContinueOnError)
fs.Usage = func() { helpCalled = true }
var flag bool
Expand Down Expand Up @@ -998,6 +998,7 @@ func getDeprecatedFlagSet() *FlagSet {
f.MarkDeprecated("badflag", "use --good-flag instead")
return f
}

func TestDeprecatedFlagInDocs(t *testing.T) {
f := getDeprecatedFlagSet()

Expand Down Expand Up @@ -1134,7 +1135,6 @@ func TestMultipleNormalizeFlagNameInvocations(t *testing.T) {
}
}

//
func TestHiddenFlagInUsage(t *testing.T) {
f := NewFlagSet("bob", ContinueOnError)
f.Bool("secretFlag", true, "shhh")
Expand All @@ -1149,7 +1149,6 @@ func TestHiddenFlagInUsage(t *testing.T) {
}
}

//
func TestHiddenFlagUsage(t *testing.T) {
f := NewFlagSet("bob", ContinueOnError)
f.Bool("secretFlag", true, "shhh")
Expand Down Expand Up @@ -1239,7 +1238,7 @@ func TestPrintDefaults(t *testing.T) {
got := buf.String()
if got != defaultOutput {
fmt.Println("\n" + got)
fmt.Println("\n" + defaultOutput)
fmt.Printf("\n" + defaultOutput)
t.Errorf("got %q want %q\n", got, defaultOutput)
}
}
Expand Down

0 comments on commit a0f4ddd

Please sign in to comment.