mirror of
https://github.com/opencontainers/runc.git
synced 2025-12-24 11:50:58 +08:00
Add linter rule to guard against use of os.Is* error functions
Signed-off-by: Curd Becker <me@curd-becker.de>
This commit is contained in:
@@ -37,6 +37,12 @@ linters:
|
||||
# going to be tricked into overwriting host files.
|
||||
- pattern: ^os\.Create$
|
||||
pkg: ^os$
|
||||
# os.Is* error checking functions predate errors.Is. Therefore, they
|
||||
# only support errors returned by the os package and subtly fail
|
||||
# to deal with other wrapped error types.
|
||||
# New code should use errors.Is(err, error-type) instead.
|
||||
- pattern: ^os\.Is(Exist|NotExist|Permission|Timeout)$
|
||||
pkg: ^os$
|
||||
analyze-types: true
|
||||
exclusions:
|
||||
rules:
|
||||
|
||||
Reference in New Issue
Block a user