I'm trying to open a file and I'd like to know if it doesn't exist to react. But the error
os.OpenFile(fName, os.O_WRONLY, 0600)
returns when the file does not exist is different than os.ErrNotExists
os.ErrNotExists -> "file does not exist"
err.(*os.PathError).Err -> "no such file or directory"
os.Stat also return the same error if the file is not there. Is there a predefined error I can compare to instead of having to do it by hand?