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

Add "untypedconst" linter #3478

Open
leonklingele opened this issue Jan 14, 2023 · 0 comments · May be fixed by #3527
Open

Add "untypedconst" linter #3478

leonklingele opened this issue Jan 14, 2023 · 0 comments · May be fixed by #3527
Labels
enhancement New feature or improvement linter: new Support new linter no decision No decision to fix or not

Comments

@leonklingele
Copy link
Member

Your feature request related to a problem? Please describe.

The untypedconst linter ensures that untyped constant expressions are not used as values of defined type (a.k.a. named type).

// The first call is valid as it is passing a typed-constant to "takesExString" which expects a typed-constant as its first parameter.
// The second call is invalid as it passes an untyped-constant which has the same underlying type as the one expected (string)
func Call() {
	takesExString(external.ExStr)
	takesExString("hoge")         // want `passing untyped constant to parameter of defined type "github.com/jiftechnify/untypedconst/pkg/external.ExString"`
[..]

https://github.com/jiftechnify/untypedconst

Describe the solution you'd like.

Describe alternatives you've considered.

Additional context.

No response

@leonklingele leonklingele added the enhancement New feature or improvement label Jan 14, 2023
@ldez ldez added linter: new Support new linter no decision No decision to fix or not labels Jan 15, 2023
leonklingele added a commit to leonklingele/golangci-lint that referenced this issue Jan 31, 2023
@leonklingele leonklingele linked a pull request Jan 31, 2023 that will close this issue
leonklingele added a commit to leonklingele/golangci-lint that referenced this issue Jan 31, 2023
leonklingele added a commit to leonklingele/golangci-lint that referenced this issue Mar 21, 2024
leonklingele added a commit to leonklingele/golangci-lint that referenced this issue Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement linter: new Support new linter no decision No decision to fix or not
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants