commented code
This commit is contained in:
@ -7,6 +7,7 @@ import (
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
// entity storing configuration values loaded from a yaml file
|
||||
type Config struct {
|
||||
Token string `yaml:"token"`
|
||||
Name string `yaml:"name"`
|
||||
@ -19,6 +20,7 @@ type Config struct {
|
||||
} `yaml:"talkback"`
|
||||
}
|
||||
|
||||
// loads the values from the yaml configuration file into the configuration register
|
||||
func (c *Config) LoadConf() *Config {
|
||||
yamlFile, err := ioutil.ReadFile("config.yaml")
|
||||
if err != nil {
|
||||
@ -31,4 +33,5 @@ func (c *Config) LoadConf() *Config {
|
||||
return c
|
||||
}
|
||||
|
||||
// global configuration register
|
||||
var ConfigRegister Config
|
||||
|
||||
Reference in New Issue
Block a user