added comment to windows filePath check
This commit is contained in:
parent
9f357f7625
commit
6503447ae7
@ -81,6 +81,7 @@ func loadDataFrom(filePath string) ([]byte, error) {
|
|||||||
}
|
}
|
||||||
return ioutil.ReadFile(filePath)
|
return ioutil.ReadFile(filePath)
|
||||||
} else if runtime.GOOS == "windows" && strings.Contains(u.String(), "\\") {
|
} 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 {
|
if _, notFoundFileErr := os.Stat(filePath); notFoundFileErr != nil {
|
||||||
return nil, fmt.Errorf("Cannot read from file: '%s' because it does not exist.", filePath)
|
return nil, fmt.Errorf("Cannot read from file: '%s' because it does not exist.", filePath)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user