mirror of https://github.com/k3s-io/k3s
Add Type() method on flags for compat with pflag library
Allows our flag objects to be used with both golang flags and pflagspull/6/head
parent
244d55b0dd
commit
c5ba95ee26
|
@ -33,3 +33,7 @@ func (sl *StringList) Set(value string) error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (*StringList) Type() string {
|
||||
return "stringList"
|
||||
}
|
||||
|
|
|
@ -37,6 +37,10 @@ func (ip *IP) Set(value string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (*IP) Type() string {
|
||||
return "ip"
|
||||
}
|
||||
|
||||
// IPNet adapts net.IPNet for use as a flag.
|
||||
type IPNet net.IPNet
|
||||
|
||||
|
@ -53,3 +57,7 @@ func (ipnet *IPNet) Set(value string) error {
|
|||
*ipnet = IPNet(*n)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (*IPNet) Type() string {
|
||||
return "ipNet"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue