Skip to content

Update unparam to the lastest version #1375

Closed
@georgysavva

Description

@georgysavva

Hi. I have a project and when I run golangci-lint It prints errors from unparam.
I consider them as false positive. Here is the code of my project: https://github.com/georgysavva/news-app/tree/unparam-false-positive
And this is the output of golangci-lint:

golangci-lint run
pkg/inmemory/inmemory.go:18:83: (*Storage).ReplaceArticles - result 0 (error) is always nil (unparam)
func (s *Storage) ReplaceArticles(_ context.Context, articles []*article.Article) error {
                                                                                  ^
pkg/inmemory/inmemory.go:37:103: (*Storage).GetArticles - result 1 (error) is always nil (unparam)
func (s *Storage) GetArticles(_ context.Context, categories, providers []string) ([]*article.Article, error) {

When I run the latest version of unparam directly, it doesn't print any error. I think golangci-lint should update its unparam version to the latest one to eliminate those false positives.
BTW I am using the latest golangci-lint v1.31.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions