small edit

This commit is contained in:
Will Ledingham
2019-07-30 16:37:24 -04:00
parent c132f7ee51
commit 2049698c8e

View File

@@ -119,16 +119,13 @@ func ParseFile(path string) (Configuration, error) {
configBox := packr.New("Config", "../../examples")
if path == "" {
rawBytes, err = configBox.Find("config.yaml")
if err != nil {
return Configuration{}, err
}
} else if strings.HasPrefix(path, "https://") || strings.HasPrefix(path, "http://") {
//path is a url
response, err := http.Get(path)
rawBytes, err = ioutil.ReadAll(response.Body)
if err != nil {
return Configuration{}, err
}
rawBytes, err = ioutil.ReadAll(response.Body)
} else {
//path is local
rawBytes, err = ioutil.ReadFile(path)