Skip to content

Commit

Permalink
unused: remove Object.Obj
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikh committed Jan 26, 2023
1 parent f1a9093 commit 9397796
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
11 changes: 0 additions & 11 deletions lintcmd/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -1072,17 +1072,6 @@ func (r *subrunner) runAnalyzers(pkgAct *packageAction, pkg *loader.Package) (an
// TODO(dh): figure out a clean abstraction, instead of
// special-casing U1000.
unusedResult = a.Result.(unused.Result)

// Unset unused.Object.Obj, which is a types.Object, so that we can encode the rest with gob.
for i := range unusedResult.Used {
unusedResult.Used[i].Obj = nil
}
for i := range unusedResult.Unused {
unusedResult.Unused[i].Obj = nil
}
for i := range unusedResult.Quiet {
unusedResult.Quiet[i].Obj = nil
}
}

for key, fact := range a.ObjectFacts {
Expand Down
4 changes: 0 additions & 4 deletions unused/unused.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ func (g *graph) objectToObject(obj types.Object) Object {
}
}
return Object{
Obj: obj,
Name: name,
ShortName: obj.Name(),
Kind: typString(obj),
Expand Down Expand Up @@ -1542,9 +1541,6 @@ func (g *SerializedGraph) color(rootID NodeID, states []nodeState) {
}

type Object struct {
// Obj is only populated for nodes that haven't been deserialized.
Obj types.Object

Name string
ShortName string
// OPT(dh): use an enum for the kind
Expand Down

0 comments on commit 9397796

Please sign in to comment.