Skip to content

Commit

Permalink
Optimize fmt statements
Browse files Browse the repository at this point in the history
  • Loading branch information
n10v committed Sep 24, 2016
1 parent c7e63cf commit 92abf19
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions bool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package pflag

import (
"bytes"
"fmt"
"strconv"
"testing"
)
Expand Down Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions count_test.go
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
2 changes: 1 addition & 1 deletion flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 92abf19

Please sign in to comment.