LoadConfig loads and parses a config file.
()
| 143 | |
| 144 | // LoadConfig loads and parses a config file. |
| 145 | func (app *App) LoadConfig() error { |
| 146 | log.Info("Loading %s configuration...", app.cfgFile) |
| 147 | cfg, err := config.Load(app.cfgFile) |
| 148 | if err != nil { |
| 149 | log.Error("Unable to load configuration: %v", err) |
| 150 | os.Exit(1) |
| 151 | return err |
| 152 | } |
| 153 | app.cfg = cfg |
| 154 | return nil |
| 155 | } |
| 156 | |
| 157 | // SaveConfig saves the given Config to disk -- namely, to the App's cfgFile. |
| 158 | func (app *App) SaveConfig(c *config.Config) error { |