Closed
Description
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