diff --git a/.golangci.yaml b/.golangci.yaml index 83dae8d06e61..9a334f867710 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,4 +1,16 @@ linters-settings: + depguard: + rules: + main: + list-mode: lax + deny: + - pkg: "io/ioutil" + desc: "Replaced by 'io' and 'os' packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil" + # Cannot use gomodguard, which examines go.mod, as "golang.org/x/exp/slices" is not a module and doesn't appear in go.mod. + - pkg: "golang.org/x/exp/slices" + desc: "Use 'slices' instead" + - pkg: "golang.org/x/exp/maps" + desc: "Use 'maps' instead" dupl: threshold: 100 errcheck: @@ -81,6 +93,7 @@ linters: disable-all: true enable: - bodyclose + - depguard - gci - goconst - gocritic