Skip to content

Replace os.IsNotExist(err) with errors.Is(err, fs.ErrNotExist)#396

Merged
roger2hk merged 1 commit intotransparency-dev:mainfrom
roger2hk:os-isnotexist
Dec 9, 2024
Merged

Replace os.IsNotExist(err) with errors.Is(err, fs.ErrNotExist)#396
roger2hk merged 1 commit intotransparency-dev:mainfrom
roger2hk:os-isnotexist

Conversation

@roger2hk
Copy link
Contributor

@roger2hk roger2hk commented Dec 6, 2024

IsNotExist returns a boolean indicating whether its argument 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).

https://golang.google.cn/pkg/os/#IsNotExist

@roger2hk roger2hk marked this pull request as ready for review December 6, 2024 21:57
@roger2hk roger2hk requested a review from mhutchinson December 6, 2024 21:57
@roger2hk roger2hk merged commit 6106156 into transparency-dev:main Dec 9, 2024
@roger2hk roger2hk deleted the os-isnotexist branch December 9, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants