Skip to content

Commit 6910df4

Browse files
committed
chore: update code
1 parent de0b39a commit 6910df4

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

pkg/golinters/unused.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,25 +63,19 @@ func runUnused(pass *analysis.Pass) ([]goanalysis.Issue, error) {
6363
return nil, err
6464
}
6565

66-
sr := unused.Serialize(pass, res.(unused.Result), pass.Fset)
67-
6866
used := make(map[string]bool)
69-
for _, obj := range sr.Used {
67+
for _, obj := range res.(unused.Result).Used {
7068
used[fmt.Sprintf("%s %d %s", obj.Position.Filename, obj.Position.Line, obj.Name)] = true
7169
}
7270

7371
var issues []goanalysis.Issue
7472

7573
// Inspired by https://github.com/dominikh/go-tools/blob/d694aadcb1f50c2d8ac0a1dd06217ebb9f654764/lintcmd/lint.go#L177-L197
76-
for _, object := range sr.Unused {
74+
for _, object := range res.(unused.Result).Unused {
7775
if object.Kind == "type param" {
7876
continue
7977
}
8078

81-
if object.InGenerated {
82-
continue
83-
}
84-
8579
key := fmt.Sprintf("%s %d %s", object.Position.Filename, object.Position.Line, object.Name)
8680
if used[key] {
8781
continue

0 commit comments

Comments
 (0)