mirror of
https://github.com/mainnika/nikita-tokarch-uk.git
synced 2026-05-25 01:03:35 +00:00
Unmarshal config values into app struct
This commit is contained in:
@@ -5,6 +5,8 @@ import (
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"code.tokarch.uk/mainnika/nikita-tokarch-uk/frontend/config"
|
||||
)
|
||||
|
||||
var Version = "nightly"
|
||||
@@ -21,5 +23,11 @@ func main() {
|
||||
logrus.Debugf("Skip invalid config file %s, %v", viper.ConfigFileUsed(), err)
|
||||
}
|
||||
|
||||
config := &config.Config{}
|
||||
if err := viper.Unmarshal(config); err != nil {
|
||||
logrus.Warnf("Cannot unmarshal config, %v", err)
|
||||
}
|
||||
|
||||
logrus.Infof("Version: %s", Version)
|
||||
logrus.Debugf("Conf: %#v", config)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user