Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint: base_resources.go: Fix structcheck/unused check #117

Closed
ppai-plivo opened this issue Aug 26, 2021 · 1 comment
Closed

lint: base_resources.go: Fix structcheck/unused check #117

ppai-plivo opened this issue Aug 26, 2021 · 1 comment

Comments

@ppai-plivo
Copy link
Contributor

Steps to reproduce:

  1. Enable structcheck and unused linters by editing .golangci.yml file:
$ git diff
diff --git a/.golangci.yml b/.golangci.yml
index b85db5a..ca0deb1 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -1,7 +1,5 @@
 linters:
   disable:
     - errcheck
-    - structcheck
-    - unused
   enable:
     - misspell
  1. Run golangci-lint:
$ golangci-lint run
base_resources.go:11:2: `client` is unused (structcheck)
	client       *PhloClient
	^
base_resources.go:12:2: `resourceType` is unused (structcheck)
	resourceType BaseResource // Todo: Need this?
	^
@huzaif-plivo
Copy link
Contributor

@ppai-plivo, as per @rdkrish-plivo structcheck has known limitations of not handling embedded structs: opennota / check
Also, there are open issues False positive for structcheck linter · Issue #1517 · golangci/golangci-lint and deprecating structcheck and other linters Deprecate varcheck, structcheck, and deadcode · Issue #1841 · golangci/golangci-lint

It is better to keep those lint checks disabled.

We can discuss internally, if we wish to take this up in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants