added comment to windows filePath check
This commit is contained in:
parent
341ca93b01
commit
f1be59ff3d
@ -81,6 +81,7 @@ func loadDataFrom(filePath string) ([]byte, error) {
|
||||
}
|
||||
return ioutil.ReadFile(filePath)
|
||||
} else if runtime.GOOS == "windows" && strings.Contains(u.String(), "\\") {
|
||||
// on Windows systems u.Path is always empty, so we need to check the string directly.
|
||||
if _, notFoundFileErr := os.Stat(filePath); notFoundFileErr != nil {
|
||||
return nil, fmt.Errorf("Cannot read from file: '%s' because it does not exist.", filePath)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user