func getConfig()

in scripts/go/analyzeCUR/analyzeCUR.go [164:183]


func getConfig(conf *Config, configFile string) error {

	// check for existance of file
	if _, err := os.Stat(configFile); err != nil {
		return errors.New("Config File " + configFile + " does not exist")
	}

	// read file
	b, err := ioutil.ReadFile(configFile)
	if err != nil {
		return errors.New("Error Reading TOML config file: " + err.Error())
	}

	// parse TOML config file into struct
	if _, err := toml.Decode(string(b), &conf); err != nil {
		return errors.New("Error Decoding TOML config file: " + err.Error())
	}

	return nil
}