diff --git a/config/config.go b/config/config.go index d210fda..37f0db8 100644 --- a/config/config.go +++ b/config/config.go @@ -359,6 +359,12 @@ 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 @@ -570,13 +576,6 @@ 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 - } - c.Token = Token{ ID: os.Getenv("WINGS_TOKEN_ID"), Token: os.Getenv("WINGS_TOKEN"),