Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2021-09-16 16:29:41 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2021-09-20 17:23:54 +0300
commitbb18ad9cb4e00d69207f856263c65b46aea37046 (patch)
tree2e2998c2bc74f1df9ce05e962ecda4da74c13a3c /.golangci.yml
parent4d63c8f0bfb5874ba2a9a68be0b3d73d9669cd09 (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 '.golangci.yml')
-rw-r--r--.golangci.yml8
1 files changed, 8 insertions, 0 deletions
diff --git a/.golangci.yml b/.golangci.yml
index d98c295a5..4b7eeab90 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -11,6 +11,7 @@ linters:
- deadcode
- errcheck
- exportloopref
+ - depguard
- gci
- gofumpt
- goimports
@@ -723,3 +724,10 @@ issues:
max-issues-per-linter: 0
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0
+
+linters-settings:
+ depguard:
+ list-type: blacklist
+ include-go-root: true
+ packages-with-error-message:
+ - io/ioutil: "ioutil is deprecated starting with Go 1.16"