Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(src): use
errors.Is(err, fs.ErrNotExist)
I implemented fs.FS. When the file does not exist, `xerrors.Wrap(fs.ErrNotExist, "")` will be returned. However, `os.IsNotExist` cannot handle this situation. I found the following comment: ``` // IsNotExist returns a boolean indicating whether the error is known to // report that a file or directory does not exist. It is satisfied by // ErrNotExist as well as some syscall errors. // // This function predates errors.Is. It only supports errors returned by // the os package. New code should use errors.Is(err, fs.ErrNotExist). ``` Therefore, we should use `errors.Is(err, fs.ErrNotExist)` instead.
- Loading branch information