Fix bug where configuration is being overridden by a default configuration
This commit is contained in:
parent
e66f6358a9
commit
a4c305c2e9
@ -87,8 +87,6 @@ func LoadConfig(s string) (*Config, error) {
|
|||||||
var err error
|
var err error
|
||||||
var c *Config = GetConfig()
|
var c *Config = GetConfig()
|
||||||
|
|
||||||
*c = DefaultConfig
|
|
||||||
|
|
||||||
if _, err := toml.Decode(s, &c); err != nil {
|
if _, err := toml.Decode(s, &c); err != nil {
|
||||||
err = fmt.Errorf("fatal: failed to parse; %w", err)
|
err = fmt.Errorf("fatal: failed to parse; %w", err)
|
||||||
}
|
}
|
||||||
@ -101,8 +99,6 @@ func LoadConfigFile(configPath string) (*Config, error) {
|
|||||||
|
|
||||||
var c *Config = GetConfig()
|
var c *Config = GetConfig()
|
||||||
|
|
||||||
*c = DefaultConfig
|
|
||||||
|
|
||||||
if _, err := toml.DecodeFile(configPath, &c); err != nil {
|
if _, err := toml.DecodeFile(configPath, &c); err != nil {
|
||||||
err = fmt.Errorf("fatal: failed to parse %s; %w", configPath, err)
|
err = fmt.Errorf("fatal: failed to parse %s; %w", configPath, err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user