blob: 56cda58b36c4738af61b160643d926f6d4cdee15 [file] [log] [blame]
Colin Cross7bb052a2015-02-03 12:59:37 -08001// Copyright 2010 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package flag
6
7import "os"
8
9// Additional routines compiled into the package only during testing.
10
11// ResetForTesting clears all flag state and sets the usage function as directed.
12// After calling ResetForTesting, parse errors in flag handling will not
13// exit the program.
14func ResetForTesting(usage func()) {
15 CommandLine = NewFlagSet(os.Args[0], ContinueOnError)
16 Usage = usage
17}