diff --git a/.golangci.yml b/.golangci.yml index d9c8fe01..397a18b4 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -35,6 +35,10 @@ issues: exclude-dirs: - example exclude-rules: + - path: cmd/* + linters: + - gochecknoglobals + - gochecknoinits - path: (.+)_test.go linters: - dupl \ No newline at end of file diff --git a/cmd/check.go b/cmd/check.go index ea3b95e2..4acddc3b 100644 --- a/cmd/check.go +++ b/cmd/check.go @@ -1,4 +1,3 @@ -//nolint:gochecknoglobals package cmd import ( @@ -53,7 +52,6 @@ var checkCmd = &cobra.Command{ }, } -//nolint:gochecknoinits func init() { rootCmd.AddCommand(checkCmd) diff --git a/cmd/rest.go b/cmd/rest.go index 6f62c033..58f156c2 100644 --- a/cmd/rest.go +++ b/cmd/rest.go @@ -11,11 +11,11 @@ import ( "github.com/bavix/gripmock/internal/deps" ) -// restCmd represents the rest command +// restCmd represents the rest command. var restCmd = &cobra.Command{ Use: "rest", Short: "Start only the rest service", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { builder := deps.NewBuilder(deps.WithDefaultConfig()) ctx, cancel := builder.SignalNotify(cmd.Context()) defer cancel() diff --git a/cmd/root.go b/cmd/root.go index e6240ee0..ba0dc613 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -1,4 +1,3 @@ -//nolint:gochecknoglobals package cmd import ( @@ -43,7 +42,6 @@ var rootCmd = &cobra.Command{ }, } -//nolint:gochecknoinits func init() { rootCmd.Flags().StringVarP( &outputFlag,