aboutsummaryrefslogtreecommitdiff
path: root/flag_test.go
diff options
context:
space:
mode:
authorMárk Sági-Kazár <[email protected]>2025-01-09 01:37:54 +0100
committerGitHub <[email protected]>2025-01-09 01:37:54 +0100
commit5ca813443bd2a4d9f46a253ea0407d23b3790713 (patch)
tree08163a44df887d7beeb7c10a26ea36badf8d7af8 /flag_test.go
parentd5e0c0615acee7028e1e2740a11102313be88de1 (diff)
parent100ab0eb250792014fc1594d94f7fb5c5f0dee37 (diff)
Merge pull request #419 from spf13/civ1.0.6
add github actions
Diffstat (limited to 'flag_test.go')
-rw-r--r--flag_test.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/flag_test.go b/flag_test.go
index 58a5d25..643f099 100644
--- a/flag_test.go
+++ b/flag_test.go
@@ -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",
@@ -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
@@ -998,6 +998,7 @@ func getDeprecatedFlagSet() *FlagSet {
f.MarkDeprecated("badflag", "use --good-flag instead")
return f
}
+
func TestDeprecatedFlagInDocs(t *testing.T) {
f := getDeprecatedFlagSet()
@@ -1134,7 +1135,6 @@ func TestMultipleNormalizeFlagNameInvocations(t *testing.T) {
}
}
-//
func TestHiddenFlagInUsage(t *testing.T) {
f := NewFlagSet("bob", ContinueOnError)
f.Bool("secretFlag", true, "shhh")
@@ -1149,7 +1149,6 @@ func TestHiddenFlagInUsage(t *testing.T) {
}
}
-//
func TestHiddenFlagUsage(t *testing.T) {
f := NewFlagSet("bob", ContinueOnError)
f.Bool("secretFlag", true, "shhh")
@@ -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)
}
}