diff options
| author | Eric Paris <[email protected]> | 2015-08-15 14:22:16 -0500 |
|---|---|---|
| committer | Eric Paris <[email protected]> | 2015-08-15 14:22:16 -0500 |
| commit | ccad0e1b8d442b5291ebbaa7d4f3b345a9dbfe65 (patch) | |
| tree | 98409d6f5f56049df54b18a9fc577cf38dff8bae /string_slice.go | |
| parent | da10e08318b7b4c0105c4df757cb1f997f439f4a (diff) | |
| parent | 0692da7b4fa7568c62b505a313ee44a5256ee7f4 (diff) | |
Merge pull request #46 from eparis/goreportcard
Fix up minor things found by goreportcard.com
Diffstat (limited to 'string_slice.go')
| -rw-r--r-- | string_slice.go | 12 |
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) } |
