From 8e1e61fc70e203d1d0277006735b4ffea8cde32d Mon Sep 17 00:00:00 2001 From: appleboy Date: Sun, 24 Mar 2024 14:23:16 +0800 Subject: [PATCH] chore: refactor linter settings and file structure - Remove `deadcode` linter and `structcheck` from `.golangci.yml` - Add settings for `depguard` linter in `.golangci.yml` - Rename `example/main.go` to `_example/main.go` Signed-off-by: appleboy --- .golangci.yml | 21 ++++++++++++++++++--- {example => _example}/main.go | 0 2 files changed, 18 insertions(+), 3 deletions(-) rename {example => _example}/main.go (100%) diff --git a/.golangci.yml b/.golangci.yml index 5a0031c..78f23ee 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -4,7 +4,6 @@ linters: fast: false enable: - bodyclose - - deadcode - depguard - dogsled - dupl @@ -29,15 +28,31 @@ linters: - nolintlint - rowserrcheck - staticcheck - - structcheck - stylecheck - typecheck - unconvert - unparam - unused - - varcheck - whitespace - gofumpt +linters-settings: + depguard: + rules: + Main: + files: + - $all + - "!$test" + allow: + - $gostd + - github.com/gin-gonic/gin + Test: + files: + - $test + allow: + - $gostd + - github.com/gin-gonic/gin + - github.com/stretchr/testify + run: timeout: 3m diff --git a/example/main.go b/_example/main.go similarity index 100% rename from example/main.go rename to _example/main.go