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 /int_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 'int_slice.go')
| -rw-r--r-- | int_slice.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/int_slice.go b/int_slice.go index 7c6ed79..1e7c9ed 100644 --- a/int_slice.go +++ b/int_slice.go @@ -85,7 +85,7 @@ func (f *FlagSet) IntSliceVar(p *[]int, name string, value []int, usage string) f.VarP(newIntSliceValue(value, p), name, "", usage) } -// Like IntSliceVar, but accepts a shorthand letter that can be used after a single dash. +// IntSliceVarP is like IntSliceVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IntSliceVarP(p *[]int, name, shorthand string, value []int, usage string) { f.VarP(newIntSliceValue(value, p), name, shorthand, usage) } @@ -96,7 +96,7 @@ func IntSliceVar(p *[]int, name string, value []int, usage string) { CommandLine.VarP(newIntSliceValue(value, p), name, "", usage) } -// Like IntSliceVar, but accepts a shorthand letter that can be used after a single dash. +// IntSliceVarP is like IntSliceVar, but accepts a shorthand letter that can be used after a single dash. func IntSliceVarP(p *[]int, name, shorthand string, value []int, usage string) { CommandLine.VarP(newIntSliceValue(value, p), name, shorthand, usage) } @@ -104,14 +104,14 @@ func IntSliceVarP(p *[]int, name, shorthand string, value []int, usage string) { // IntSlice defines a []int flag with specified name, default value, and usage string. // The return value is the address of a []int variable that stores the value of the flag. func (f *FlagSet) IntSlice(name string, value []int, usage string) *[]int { - p := make([]int, 0) + p := []int{} f.IntSliceVarP(&p, name, "", value, usage) return &p } -// Like IntSlice, but accepts a shorthand letter that can be used after a single dash. +// IntSliceP is like IntSlice, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IntSliceP(name, shorthand string, value []int, usage string) *[]int { - p := make([]int, 0) + p := []int{} f.IntSliceVarP(&p, name, shorthand, value, usage) return &p } @@ -122,7 +122,7 @@ func IntSlice(name string, value []int, usage string) *[]int { return CommandLine.IntSliceP(name, "", value, usage) } -// Like IntSlice, but accepts a shorthand letter that can be used after a single dash. +// IntSliceP is like IntSlice, but accepts a shorthand letter that can be used after a single dash. func IntSliceP(name, shorthand string, value []int, usage string) *[]int { return CommandLine.IntSliceP(name, shorthand, value, usage) } |
