I'm trying to test the following branch:
if _, err := os.Stat(path); err != nil {
if os.IsNotExist(err) {
continue
}
return errors.File().AddDetails(err)
}
Obviously, os.Stat
is going to throw an error if path
doesn't exist. Reading the Golang documentation returns no details about the errors that os.Stat
could return. Is there way to have os.Stat
throw another kind of error?