aboutsummaryrefslogtreecommitdiff
path: root/flag.go
diff options
context:
space:
mode:
authorEric Paris <[email protected]>2015-08-15 13:53:10 -0400
committerEric Paris <[email protected]>2015-08-15 15:25:20 -0400
commit30f7e99b82e30299f499c1aa13638dd937e075f3 (patch)
tree7594f5d517b6585d961765443d6fa48c580f21a5 /flag.go
parentccad0e1b8d442b5291ebbaa7d4f3b345a9dbfe65 (diff)
Use Type() instead of internal .(*stringValue)
This makes things easier to read/understand and it also means that users who declare their own flags and call them "string" will get quotes as well.
Diffstat (limited to 'flag.go')
-rw-r--r--flag.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/flag.go b/flag.go
index 81b3c1f..c99ccf3 100644
--- a/flag.go
+++ b/flag.go
@@ -387,7 +387,7 @@ func (f *FlagSet) FlagUsages() string {
if len(flag.NoOptDefVal) > 0 {
format = format + "["
}
- if _, ok := flag.Value.(*stringValue); ok {
+ if flag.Value.Type() == "string" {
// put quotes on the value
format = format + "=%q"
} else {