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