7 "github.com/ghodss/yaml"
10 // LoadFile loads configuration from the file given by configPath and
11 // decodes it into cfg.
13 // YAML and JSON formats are supported.
14 func LoadFile(cfg interface{}, configPath string) error {
15 buf, err := ioutil.ReadFile(configPath)
19 err = yaml.Unmarshal(buf, cfg)
21 return fmt.Errorf("Error decoding config %q: %v", configPath, err)