mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +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.
|
# going to be tricked into overwriting host files.
|
||||||
- pattern: ^os\.Create$
|
- pattern: ^os\.Create$
|
||||||
pkg: ^os$
|
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
|
analyze-types: true
|
||||||
exclusions:
|
exclusions:
|
||||||
rules:
|
rules:
|
||||||
|
|||||||
Reference in New Issue
Block a user