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

Ignore generic types #37

Closed
palsivertsen opened this issue Apr 6, 2022 · 7 comments · Fixed by #42 or #82
Closed

Ignore generic types #37

palsivertsen opened this issue Apr 6, 2022 · 7 comments · Fixed by #42 or #82
Assignees

Comments

@palsivertsen
Copy link

ireturn should ignore generic type parameters.

I get an error when using ireturn on this code:

package example

type Map[K comparable, V any] map[K]V

func (m Map[K, V]) Get(key K) V { return m[key] }

image

golangci-lint has version 1.45.2 built from 8bdc4d3f on 2022-03-24T11:51:26Z

@butuzov
Copy link
Owner

butuzov commented Apr 6, 2022 via email

@palsivertsen
Copy link
Author

Stay strong!

@iwata
Copy link

iwata commented Oct 5, 2022

@butuzov Any progress?

@butuzov
Copy link
Owner

butuzov commented Oct 5, 2022

@iwata well...we took some lands back, more to go. As for this feature, no wasn't using editor since 25th february as I am at war. Man i wish to back to coding, but there are more important things when you country trying to survive.

@palsivertsen
Copy link
Author

I believe this is still an issue.

@mitar
Copy link

mitar commented Sep 21, 2023

Also an issue for me with golangci-lint 1.54.2.

@butuzov butuzov reopened this Sep 28, 2023
@butuzov butuzov self-assigned this Sep 28, 2023
butuzov added a commit that referenced this issue Jan 23, 2024
due to golang/go#50956 I must to drop check
for typeParams (which is `nil` for methods). So from now on, i am
checking if param is interface implementation, then exclude one by one
interface types.

Added new tests.

closes #37
butuzov added a commit that referenced this issue Jan 23, 2024
* dev: Fix for missing TypeParams in methods

due to golang/go#50956 I must to drop check
for typeParams (which is `nil` for methods). So from now on, i am
checking if param is interface implementation, then exclude one by one
interface types.

- Added new tests.
- Added compatibility code (to align with go1.18 and go1.19 type params representation)

closes #37
@butuzov
Copy link
Owner

butuzov commented Jan 23, 2024

You can now build it from sources, and i will release new version as soon as go1.22 releases and I be alive till that momemnt.

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