gomod more
This commit is contained in:
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 {
|
func (a *Arg) GetInt() int {
|
||||||
if a.ArgType != INT {
|
if a.ArgType != INT {
|
||||||
return -1
|
return -1
|
||||||
|
|||||||
@@ -54,6 +54,11 @@ func (as *ArgSet) Get(key string) *Arg {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (as *ArgSet) GetFloat(key string) float32 {
|
||||||
|
a := as.Get(key)
|
||||||
|
return a.GetFloat()
|
||||||
|
}
|
||||||
|
|
||||||
func (as *ArgSet) GetInt(key string) int {
|
func (as *ArgSet) GetInt(key string) int {
|
||||||
a := as.Get(key)
|
a := as.Get(key)
|
||||||
return a.GetInt()
|
return a.GetInt()
|
||||||
|
|||||||
5
go.mod
Normal file
5
go.mod
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
module local/args
|
||||||
|
|
||||||
|
go 1.16
|
||||||
|
|
||||||
|
require gopkg.in/yaml.v2 v2.4.0
|
||||||
4
go.sum
Normal file
4
go.sum
Normal file
@@ -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=
|
||||||
Reference in New Issue
Block a user