This commit is contained in:
parent
41e82fb21e
commit
94e1920098
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user