print error
This commit is contained in:
parent
9ebfbbf77a
commit
297f72dd97
8
main.go
8
main.go
@ -80,6 +80,7 @@ func (c *Config) DefineDefault(key string, val string, dtype DataType) {
|
||||
}
|
||||
|
||||
func (c *Config) Parse() {
|
||||
c.parsed = true
|
||||
parsers := make(map[DataType](func(string)(cValue)))
|
||||
parsers[TypeInt] = parseInt
|
||||
parsers[TypeDuration] = parseDuration
|
||||
@ -98,6 +99,13 @@ func (c *Config) Parse() {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Config) Show() {
|
||||
for _,v := range c.env {
|
||||
fmt.Println(v.parsed.err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func parseInt(str string)(ret cValue) {
|
||||
ret.intval, ret.err = strconv.ParseInt(str, 10, 64)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user