envconf/tests/main.go

18 lines
316 B
Go
Raw Permalink Normal View History

2022-01-29 12:29:09 +00:00
package main
2022-01-29 12:31:31 +00:00
import (
"fmt"
"git.purser.it/roypur/envconf"
)
2022-01-29 12:29:09 +00:00
func main() {
conf := envconf.NewConfig()
2022-01-29 20:51:28 +00:00
conf.Define("this_is_a_map", envconf.TypeInt)
2022-01-29 21:03:33 +00:00
conf.DefineMap("test_map", envconf.TypeInt)
2022-01-29 12:29:09 +00:00
conf.Parse()
conf.Status()
2022-01-29 20:51:28 +00:00
fmt.Println(conf.GetMapInt("test_map"))
2022-01-29 20:59:03 +00:00
fmt.Println(conf.GetInt("this_is_a_map"))
2022-01-29 12:29:09 +00:00
}