New custom flag parser: ArrayArgs
This commit is contained in:
parent
f16ae2991e
commit
c384c10a88
1 changed files with 17 additions and 0 deletions
|
|
@ -25,8 +25,25 @@ import (
|
|||
"encoding/base64"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type ArrayArgs struct {
|
||||
Slice *[]string
|
||||
}
|
||||
|
||||
func (i *ArrayArgs) String() string {
|
||||
if i == nil || i.Slice == nil {
|
||||
return ""
|
||||
}
|
||||
return strings.Join(*i.Slice, ",")
|
||||
}
|
||||
|
||||
func (i *ArrayArgs) Set(value string) error {
|
||||
*i.Slice = append(*i.Slice, value)
|
||||
return nil
|
||||
}
|
||||
|
||||
type JWTSecretKey struct {
|
||||
Secret *[]byte
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue