diff --git a/config/config.go b/config/config.go index 3770115..1b7dbe8 100644 --- a/config/config.go +++ b/config/config.go @@ -332,12 +332,6 @@ type Configuration struct { // This function does not modify the currently stored global configuration. func NewAtPath(path string) (*Configuration, error) { var c Configuration - // Configures the default values for many of the configuration options present - // in the structs. Values set in the configuration file take priority over the - // default values. - if err := defaults.Set(&c); err != nil { - return nil, err - } // Track the location where we created this configuration. c.path = path return &c, nil @@ -513,6 +507,13 @@ func FromFile(path string) error { return err } + // Configures the default values for many of the configuration options present + // in the structs. Values set in the configuration file will not be overridden by the + // default values. + if err := defaults.Set(c); err != nil { + return err + } + // Store this configuration in the global state. Set(c) return nil