diff options
| author | bogem <[email protected]> | 2016-09-24 23:41:08 +0200 |
|---|---|---|
| committer | bogem <[email protected]> | 2016-09-25 00:24:05 +0200 |
| commit | 92abf1943761d39805d58c36456e757becf78b92 (patch) | |
| tree | 4320ce2c9a98a978416b0d368619244ddaaeec69 | |
| parent | c7e63cf4530bcd3ba943729cee0efeff2ebea63f (diff) | |
Optimize fmt statements
| -rw-r--r-- | bool_test.go | 3 | ||||
| -rw-r--r-- | count_test.go | 3 | ||||
| -rw-r--r-- | flag.go | 2 |
3 files changed, 2 insertions, 6 deletions
diff --git a/bool_test.go b/bool_test.go index 3e38a0f..a4319e7 100644 --- a/bool_test.go +++ b/bool_test.go @@ -6,7 +6,6 @@ package pflag import ( "bytes" - "fmt" "strconv" "testing" ) @@ -48,7 +47,7 @@ func (v *triStateValue) String() string { if *v == triStateMaybe { return strTriStateMaybe } - return fmt.Sprintf("%v", bool(*v == triStateTrue)) + return strconv.FormatBool(*v == triStateTrue) } // The type of the flag as required by the pflag.Value interface diff --git a/count_test.go b/count_test.go index 716765c..460d96a 100644 --- a/count_test.go +++ b/count_test.go @@ -1,13 +1,10 @@ package pflag import ( - "fmt" "os" "testing" ) -var _ = fmt.Printf - func setUpCount(c *int) *FlagSet { f := NewFlagSet("test", ContinueOnError) f.CountVarP(c, "verbose", "v", "a counter") @@ -416,7 +416,7 @@ func Set(name, value string) error { // otherwise, the default values of all defined flags in the set. func (f *FlagSet) PrintDefaults() { usages := f.FlagUsages() - fmt.Fprintf(f.out(), "%s", usages) + fmt.Fprint(f.out(), usages) } // defaultIsZeroValue returns true if the default value for this flag represents |
