diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-09-16 16:29:41 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-09-20 17:23:54 +0300 |
commit | bb18ad9cb4e00d69207f856263c65b46aea37046 (patch) | |
tree | 2e2998c2bc74f1df9ce05e962ecda4da74c13a3c /internal/cache | |
parent | 4d63c8f0bfb5874ba2a9a68be0b3d73d9669cd09 (diff) |
golangci: Disallow usage of "io/ioutil" package
The "io/ioutil" package has been deprecated in Go 1.16 and thus
shouldn't be used in our codebase anymore. Disallow its usage by adding
the "depguard" linter with a single entry for this specific package.
Note that we still use the package in some places where we used to rely
on `ioutil.ReadDir()`'s old behaviour of stat'ting all directory
entries. Conversion of these is not part of this patch series given that
it would be a change in behaviour compared to all the other changes
which aren't. Those sites are thus annotated with `nolint` directives.
Diffstat (limited to 'internal/cache')
-rw-r--r-- | internal/cache/keyer.go | 1 | ||||
-rw-r--r-- | internal/cache/walker.go | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/internal/cache/keyer.go b/internal/cache/keyer.go index 1149103b3..31e810d14 100644 --- a/internal/cache/keyer.go +++ b/internal/cache/keyer.go @@ -1,5 +1,6 @@ package cache +//nolint:depguard import ( "context" "crypto/sha256" diff --git a/internal/cache/walker.go b/internal/cache/walker.go index a71a2819c..bfd5fba01 100644 --- a/internal/cache/walker.go +++ b/internal/cache/walker.go @@ -5,6 +5,7 @@ // worker will walk the cache directory every ten minutes. package cache +//nolint:depguard import ( "fmt" "io/ioutil" |