Commit c2a73881 authored by Kevin Lyda's avatar Kevin Lyda 💬
Browse files

Read config.

parent bb3257c1
/pjls
/config
/config.json
......@@ -16,8 +16,10 @@ func main() {
viper.SetConfigName("config")
viper.AddConfigPath(".")
viper.SetConfigType("json")
err := viper.ReadInConfig()
viper.Unmarshal(&c)
c.token = viper.Get("token")
c.baseurl = viper.Get("baseurl")
if err != nil {
panic(fmt.Errorf("Fatal error config file: %s \n", err))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment