aboutsummaryrefslogtreecommitdiff
path: root/flag_test.go
diff options
context:
space:
mode:
authorHu Jun <[email protected]>2024-12-27 12:06:14 -0800
committerHu Jun <[email protected]>2024-12-27 12:06:14 -0800
commit1118d46dfe34c2d77aee04d819315a21942aa444 (patch)
tree6dc9f270994b1db1a37499015b7596e490e882b4 /flag_test.go
parentd5e0c0615acee7028e1e2740a11102313be88de1 (diff)
add support equivalent to golang flag.TextVar(), also fixes the test failure as described in #368
Diffstat (limited to 'flag_test.go')
-rw-r--r--flag_test.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/flag_test.go b/flag_test.go
index 58a5d25..9faaba4 100644
--- a/flag_test.go
+++ b/flag_test.go
@@ -1134,7 +1134,6 @@ func TestMultipleNormalizeFlagNameInvocations(t *testing.T) {
}
}
-//
func TestHiddenFlagInUsage(t *testing.T) {
f := NewFlagSet("bob", ContinueOnError)
f.Bool("secretFlag", true, "shhh")
@@ -1149,7 +1148,6 @@ func TestHiddenFlagInUsage(t *testing.T) {
}
}
-//
func TestHiddenFlagUsage(t *testing.T) {
f := NewFlagSet("bob", ContinueOnError)
f.Bool("secretFlag", true, "shhh")
@@ -1238,8 +1236,8 @@ func TestPrintDefaults(t *testing.T) {
fs.PrintDefaults()
got := buf.String()
if got != defaultOutput {
- fmt.Println("\n" + got)
- fmt.Println("\n" + defaultOutput)
+ fmt.Print("\n" + got + "\n")
+ fmt.Print("\n" + defaultOutput + "\n")
t.Errorf("got %q want %q\n", got, defaultOutput)
}
}