From f60eee4894cfa07e8a969425c72d291f80f3053a Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Thu, 23 Jan 2014 13:00:23 -0700 Subject: [PATCH] Fix mflag test issue with "ResetForTesting" (which only showed up under dyntest for some odd reason) Docker-DCO-1.1-Signed-off-by: Andrew Page (github: tianon) --- pkg/mflag/export_test.go | 17 ----------------- pkg/mflag/flag_test.go | 7 +++++++ 2 files changed, 7 insertions(+), 17 deletions(-) delete mode 100644 pkg/mflag/export_test.go diff --git a/pkg/mflag/export_test.go b/pkg/mflag/export_test.go deleted file mode 100644 index 7c1cea0bd7..0000000000 --- a/pkg/mflag/export_test.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2014 The Docker & Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mflag - -import "os" - -// Additional routines compiled into the package only during testing. - -// ResetForTesting clears all flag state and sets the usage function as directed. -// After calling ResetForTesting, parse errors in flag handling will not -// exit the program. -func ResetForTesting(usage func()) { - CommandLine = NewFlagSet(os.Args[0], ContinueOnError) - Usage = usage -} diff --git a/pkg/mflag/flag_test.go b/pkg/mflag/flag_test.go index aecbbd0fbb..631febca47 100644 --- a/pkg/mflag/flag_test.go +++ b/pkg/mflag/flag_test.go @@ -15,6 +15,13 @@ import ( "time" ) +// ResetForTesting clears all flag state and sets the usage function as directed. +// After calling ResetForTesting, parse errors in flag handling will not +// exit the program. +func ResetForTesting(usage func()) { + CommandLine = NewFlagSet(os.Args[0], ContinueOnError) + Usage = usage +} func boolString(s string) string { if s == "0" { return "false"