Skip to content

Commit 18a0abd

Browse files
committed
Add docstrings to appease lint
1 parent 9529cf0 commit 18a0abd

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

mflag/flag.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ import (
8585
"fmt"
8686
"io"
8787
"os"
88-
"runtime"
8988
"sort"
9089
"strconv"
9190
"strings"

mflagext/listvar.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ type listOpts struct {
1111
hasBeenSet bool
1212
}
1313

14+
// ListVar creates an mflag.Var for repeated flags.
1415
func ListVar(p *[]string, names []string, value []string, usage string) {
1516
*p = value
1617
mflag.Var(&listOpts{p, false}, names, usage)
1718
}
1819

20+
// Set implements mflag.Var
1921
func (opts *listOpts) Set(value string) error {
2022
if opts.hasBeenSet {
2123
(*opts.value) = append((*opts.value), value)
@@ -26,6 +28,7 @@ func (opts *listOpts) Set(value string) error {
2628
return nil
2729
}
2830

31+
// String implements mflag.Var
2932
func (opts *listOpts) String() string {
3033
return fmt.Sprintf("%v", []string(*opts.value))
3134
}

0 commit comments

Comments
 (0)