Merge pull request #94 from bogem/noverbs
Optimize fmt statements
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 @@
import (
"bytes"
- "fmt"
"strconv"
"testing"
)
@@ -48,7 +47,7 @@
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")
diff --git a/flag.go b/flag.go
index b0b0d46..4258f45 100644
--- a/flag.go
+++ b/flag.go
@@ -416,7 +416,7 @@
// 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