Skip to content

Commit 64951cf

Browse files
committed
chore: isolate code from x/tools
1 parent e315337 commit 64951cf

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

pkg/goanalysis/runner_action.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -210,17 +210,6 @@ func (act *action) exportObjectFact(obj types.Object, fact analysis.Fact) {
210210
}
211211
}
212212

213-
func (act *action) allObjectFacts() []analysis.ObjectFact {
214-
out := make([]analysis.ObjectFact, 0, len(act.objectFacts))
215-
for key, fact := range act.objectFacts {
216-
out = append(out, analysis.ObjectFact{
217-
Object: key.obj,
218-
Fact: fact,
219-
})
220-
}
221-
return out
222-
}
223-
224213
// importPackageFact implements Pass.ImportPackageFact.
225214
// Given a non-nil pointer ptr of type *T, where *T satisfies Fact,
226215
// fact copies the fact value to *ptr.

pkg/goanalysis/runner_base.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,19 @@ import (
1313
"golang.org/x/tools/go/analysis"
1414
)
1515

16-
// NOTE(ldez) altered: removes code related to `act.pass.ExportPackageFact`; logger; act.factType.
16+
// NOTE(ldez) no alteration.
17+
func (act *action) allObjectFacts() []analysis.ObjectFact {
18+
out := make([]analysis.ObjectFact, 0, len(act.objectFacts))
19+
for key, fact := range act.objectFacts {
20+
out = append(out, analysis.ObjectFact{
21+
Object: key.obj,
22+
Fact: fact,
23+
})
24+
}
25+
return out
26+
}
27+
28+
// NOTE(ldez) altered: removes code related to `act.pass.ExportPackageFact`; logger; `act.factType`.
1729
// exportPackageFact implements Pass.ExportPackageFact.
1830
func (act *action) exportPackageFact(fact analysis.Fact) {
1931
key := packageFactKey{act.pass.Pkg, act.factType(fact)}

0 commit comments

Comments
 (0)