gomod more
parent
2bf49d7b3c
commit
9048291615
4
arg.go
4
arg.go
|
|
@ -39,6 +39,10 @@ func (a *Arg) String() string {
|
|||
)
|
||||
}
|
||||
|
||||
func (a *Arg) Get() interface{} {
|
||||
return a.Value
|
||||
}
|
||||
|
||||
func (a *Arg) GetInt() int {
|
||||
if a.ArgType != INT {
|
||||
return -1
|
||||
|
|
|
|||
|
|
@ -54,6 +54,11 @@ func (as *ArgSet) Get(key string) *Arg {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (as *ArgSet) GetFloat(key string) float32 {
|
||||
a := as.Get(key)
|
||||
return a.GetFloat()
|
||||
}
|
||||
|
||||
func (as *ArgSet) GetInt(key string) int {
|
||||
a := as.Get(key)
|
||||
return a.GetInt()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
module local/args
|
||||
|
||||
go 1.16
|
||||
|
||||
require gopkg.in/yaml.v2 v2.4.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
Loading…
Reference in New Issue