Skip to content

Commit

Permalink
refactor: remove lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
chavacava committed Dec 7, 2024
1 parent a106e63 commit c024dad
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions internal/astutils/ast_utils.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package astutils provides utility functions for working with AST nodes
package astutils

import "go/ast"
Expand Down
1 change: 0 additions & 1 deletion rule/confusing_results.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions rule/datarace.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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 {
Expand Down

0 comments on commit c024dad

Please sign in to comment.