gomod more

master
Bel LaPointe 2021-09-17 08:08:21 -06:00
parent 2bf49d7b3c
commit 9048291615
4 changed files with 18 additions and 0 deletions

4
arg.go
View File

@ -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

View File

@ -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
View File

@ -0,0 +1,5 @@
module local/args
go 1.16
require gopkg.in/yaml.v2 v2.4.0

4
go.sum Normal file
View 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=