summaryrefslogtreecommitdiff
path: root/example_test.go
diff options
context:
space:
mode:
authorHugo Hromic <[email protected]>2024-06-27 00:02:41 +0100
committerHugo Hromic <[email protected]>2024-06-27 00:33:09 +0100
commitaa844c7de9f0314b1fe66b9bdcc12090c7d0905e (patch)
treed0157b78d82c7667de1973da81e8d108b1ed509a /example_test.go
parentdfca71d1594a749ef5e2203e84cfb5a1b8e9387b (diff)
Fix crash on errors in package-level `MustParse`
Diffstat (limited to 'example_test.go')
-rw-r--r--example_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/example_test.go b/example_test.go
index 4bd7632..d3622bf 100644
--- a/example_test.go
+++ b/example_test.go
@@ -163,6 +163,7 @@ func Example_helpText() {
// This is only necessary when running inside golang's runnable example harness
mustParseExit = func(int) {}
+ mustParseOut = os.Stdout
MustParse(&args)
@@ -195,6 +196,7 @@ func Example_helpPlaceholder() {
// This is only necessary when running inside golang's runnable example harness
mustParseExit = func(int) {}
+ mustParseOut = os.Stdout
MustParse(&args)
@@ -235,6 +237,7 @@ func Example_helpTextWithSubcommand() {
// This is only necessary when running inside golang's runnable example harness
mustParseExit = func(int) {}
+ mustParseOut = os.Stdout
MustParse(&args)
@@ -272,6 +275,7 @@ func Example_helpTextWhenUsingSubcommand() {
// This is only necessary when running inside golang's runnable example harness
mustParseExit = func(int) {}
+ mustParseOut = os.Stdout
MustParse(&args)
@@ -392,6 +396,7 @@ func Example_errorText() {
// This is only necessary when running inside golang's runnable example harness
mustParseExit = func(int) {}
+ mustParseOut = os.Stdout
MustParse(&args)
@@ -415,6 +420,7 @@ func Example_errorTextForSubcommand() {
// This is only necessary when running inside golang's runnable example harness
mustParseExit = func(int) {}
+ mustParseOut = os.Stdout
MustParse(&args)
@@ -450,6 +456,7 @@ func Example_subcommand() {
// This is only necessary when running inside golang's runnable example harness
mustParseExit = func(int) {}
+ mustParseOut = os.Stdout
MustParse(&args)