diff --git a/internal/astutils/ast_utils.go b/internal/astutils/ast_utils.go index 5a66f11fa..876d9a7a5 100644 --- a/internal/astutils/ast_utils.go +++ b/internal/astutils/ast_utils.go @@ -1,3 +1,4 @@ +// Package astutils provides utility functions for working with AST nodes package astutils import "go/ast" diff --git a/rule/confusing_results.go b/rule/confusing_results.go index c1804d124..1f5c16ba4 100644 --- a/rule/confusing_results.go +++ b/rule/confusing_results.go @@ -28,7 +28,6 @@ func (*ConfusingResultsRule) Apply(file *lint.File, _ lint.Arguments) []lint.Fai lastType := "" for _, result := range funcDecl.Type.Results.List { - resultTypeName := gofmt(result.Type) if resultTypeName == lastType { diff --git a/rule/datarace.go b/rule/datarace.go index d95775d91..e6b4dcf46 100644 --- a/rule/datarace.go +++ b/rule/datarace.go @@ -24,7 +24,7 @@ func (r *DataRaceRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure { returnIDs := map[*ast.Object]struct{}{} if funcResults != nil { - returnIDs = r.ExtractReturnIDs(funcResults.List) + returnIDs = r.extractReturnIDs(funcResults.List) } onFailure := func(failure lint.Failure) { @@ -49,7 +49,7 @@ func (*DataRaceRule) Name() string { return "datarace" } -func (*DataRaceRule) ExtractReturnIDs(fields []*ast.Field) map[*ast.Object]struct{} { +func (*DataRaceRule) extractReturnIDs(fields []*ast.Field) map[*ast.Object]struct{} { r := map[*ast.Object]struct{}{} for _, f := range fields { for _, id := range f.Names {