Skip to content

Commit 136e1b7

Browse files
committed
golangci-lint: enable depguard for packages that moved
Prevent accidental imports of the packages that moved to a separate module, but that are now an alias. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent f5ce2f2 commit 136e1b7

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.golangci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
linters:
22
enable:
3+
- depguard # Checks for imports that shouldn't be used.
34
- exportloopref # Checks for pointers to enclosing loop variables
45
- gofmt
56
- goimports
@@ -61,6 +62,16 @@ issues:
6162

6263

6364
linters-settings:
65+
depguard:
66+
rules:
67+
main:
68+
deny:
69+
- pkg: "github.com/containerd/containerd/errdefs"
70+
desc: The containerd errdefs package was migrated to a separate module. Use github.com/containerd/errdefs instead.
71+
- pkg: "github.com/containerd/containerd/log"
72+
desc: The containerd log package was migrated to a separate module. Use github.com/containerd/log instead.
73+
- pkg: "github.com/containerd/containerd/platforms"
74+
desc: The containerd log package was migrated to a separate module. Use github.com/containerd/platforms instead.
6475
gosec:
6576
# The following issues surfaced when `gosec` linter
6677
# was enabled. They are temporarily excluded to unblock

0 commit comments

Comments
 (0)