2016-08-05 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / libgo / go / flag / export_test.go
blob12d3dc76dfec50819dae251d62db0013d726c8f3
1 // 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.
5 package flag
7 import "os"
9 // Additional routines compiled into the package only during testing.
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.
14 func ResetForTesting(usage func()) {
15 CommandLine = NewFlagSet(os.Args[0], ContinueOnError)
16 Usage = usage