// readConfigFromFile reads the specified config file at `path` and attempts to
// unmarshal its content into a Config. The config param specifies the previous
// default config. If the path, only specifies a few fields in the Toml file
// the defaults from the config parameter will be used for all other fields.
readConfigFromFile reads the specified config file at `path` and attempts to
unmarshal its content into a Config. The config param specifies the previous
default config. If the path, only specifies a few fields in the Toml file
the defaults from the config parameter will be used for all other fields.
// readConfigFromFile reads the specified config file at ` path ` and attempts to // unmarshal its content into a Config . The config param specifies the previous // default config . If the path only specifies a few fields in the Toml file // the defaults from the config parameter will be used for all other fields .
func readConfigFromFile(path string, config *Config) (*Config, error) {
	logrus.Debugf("Reading configuration file %q", path)
	_, err := toml.DecodeFile(path, config)
	if err != nil {
		return nil, fmt.Errorf("unable to decode configuration %v: %v", path, err)
	}
	if config.Engine.VolumePath != "" {
		config.Engine.VolumePathSet = true
	}
	if config.Engine.StaticDir != "" {
		config.Engine.StaticDirSet = true
	}
	if config.Engine.TmpDir != "" {
		config.Engine.TmpDirSet = true
	}
	return config, err
}
func readConfigFromFile ( path string , config * Config ) ( * Config , error ) { logrus . Debugf ( " " , path ) _ , err := toml . DecodeFile ( path , config ) if err != nil { return nil , fmt . Errorf ( " " , path , err ) } if config . Engine . VolumePath != " " { config . Engine . VolumePathSet = true } if config . Engine . StaticDir != " " { config . Engine . StaticDirSet = true } if config . Engine . TmpDir != " " { config . Engine . TmpDirSet = true } return config , err }
readConfigFromFile reads the specified config file at `path` and attempts to
unmarshal its content into a Config.
readConfigFromFile reads the specified config file at ` path ` and attempts to unmarshal its content into a Config .