Improve config
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Torjus Håkestad 2022-01-19 00:39:49 +01:00
parent 41e82fb21e
commit 94e1920098

View File

@ -22,15 +22,13 @@ type ServerStoreConfig struct {
func ServerConfigFromReader(r io.Reader) (*ServerConfig, error) {
decoder := toml.NewDecoder(r)
var c ServerConfig
c := ServerConfig{
Store: &ServerStoreConfig{},
}
if err := decoder.Decode(&c); err != nil {
return nil, fmt.Errorf("error decoding server config: %w", err)
}
if c.Store == nil {
c.Store = &ServerStoreConfig{}
}
c.updateFromEnv()
return &c, nil