aboutsummaryrefslogtreecommitdiff
path: root/string_slice.go
diff options
context:
space:
mode:
authorEric Paris <[email protected]>2015-08-15 14:36:24 -0400
committerEric Paris <[email protected]>2015-08-15 15:10:25 -0400
commit0692da7b4fa7568c62b505a313ee44a5256ee7f4 (patch)
tree073d50d4008eb882cdbe0e9f6a6eff943f5db256 /string_slice.go
parent1ad164813157ed6d752ca39b5ac46eb3ae99093b (diff)
Fix up minor things found by goreportcard.com
Diffstat (limited to 'string_slice.go')
-rw-r--r--string_slice.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/string_slice.go b/string_slice.go
index 848bea8..0b7ddfe 100644
--- a/string_slice.go
+++ b/string_slice.go
@@ -62,7 +62,7 @@ func (f *FlagSet) StringSliceVar(p *[]string, name string, value []string, usage
f.VarP(newStringSliceValue(value, p), name, "", usage)
}
-// Like StringSliceVar, but accepts a shorthand letter that can be used after a single dash.
+// StringSliceVarP is like StringSliceVar, but accepts a shorthand letter that can be used after a single dash.
func (f *FlagSet) StringSliceVarP(p *[]string, name, shorthand string, value []string, usage string) {
f.VarP(newStringSliceValue(value, p), name, shorthand, usage)
}
@@ -73,7 +73,7 @@ func StringSliceVar(p *[]string, name string, value []string, usage string) {
CommandLine.VarP(newStringSliceValue(value, p), name, "", usage)
}
-// Like StringSliceVar, but accepts a shorthand letter that can be used after a single dash.
+// StringSliceVarP is like StringSliceVar, but accepts a shorthand letter that can be used after a single dash.
func StringSliceVarP(p *[]string, name, shorthand string, value []string, usage string) {
CommandLine.VarP(newStringSliceValue(value, p), name, shorthand, usage)
}
@@ -81,14 +81,14 @@ func StringSliceVarP(p *[]string, name, shorthand string, value []string, usage
// StringSlice defines a string flag with specified name, default value, and usage string.
// The return value is the address of a []string variable that stores the value of the flag.
func (f *FlagSet) StringSlice(name string, value []string, usage string) *[]string {
- p := make([]string, 0)
+ p := []string{}
f.StringSliceVarP(&p, name, "", value, usage)
return &p
}
-// Like StringSlice, but accepts a shorthand letter that can be used after a single dash.
+// StringSliceP is like StringSlice, but accepts a shorthand letter that can be used after a single dash.
func (f *FlagSet) StringSliceP(name, shorthand string, value []string, usage string) *[]string {
- p := make([]string, 0)
+ p := []string{}
f.StringSliceVarP(&p, name, shorthand, value, usage)
return &p
}
@@ -99,7 +99,7 @@ func StringSlice(name string, value []string, usage string) *[]string {
return CommandLine.StringSliceP(name, "", value, usage)
}
-// Like StringSlice, but accepts a shorthand letter that can be used after a single dash.
+// StringSliceP is like StringSlice, but accepts a shorthand letter that can be used after a single dash.
func StringSliceP(name, shorthand string, value []string, usage string) *[]string {
return CommandLine.StringSliceP(name, shorthand, value, usage)
}