From fc678a46fb7fcef2879c7361da75cd77ec172444 Mon Sep 17 00:00:00 2001 From: Alex Ogier Date: Wed, 19 Dec 2012 04:48:58 -0500 Subject: Squelch internal error messages while testing --- export_test.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/export_test.go b/export_test.go index 8ff8e29..8c74635 100644 --- a/export_test.go +++ b/export_test.go @@ -4,7 +4,10 @@ package pflag -import "os" +import ( + "io/ioutil" + "os" +) // Additional routines compiled into the package only during testing. @@ -12,7 +15,11 @@ import "os" // After calling ResetForTesting, parse errors in flag handling will not // exit the program. func ResetForTesting(usage func()) { - commandLine = NewFlagSet(os.Args[0], ContinueOnError) + commandLine = &FlagSet{ + name: os.Args[0], + errorHandling: ContinueOnError, + output: ioutil.Discard, + } Usage = usage } -- cgit v1.2.3