File tree Expand file tree Collapse file tree 2 files changed +16
-15
lines changed
Expand file tree Collapse file tree 2 files changed +16
-15
lines changed Original file line number Diff line number Diff line change @@ -179,21 +179,6 @@ func (act *action) analyze() {
179179 }
180180}
181181
182- // importObjectFact implements Pass.ImportObjectFact.
183- // Given a non-nil pointer ptr of type *T, where *T satisfies Fact,
184- // importObjectFact copies the fact value to *ptr.
185- func (act * action ) importObjectFact (obj types.Object , ptr analysis.Fact ) bool {
186- if obj == nil {
187- panic ("nil object" )
188- }
189- key := objectFactKey {obj , act .factType (ptr )}
190- if v , ok := act .objectFacts [key ]; ok {
191- reflect .ValueOf (ptr ).Elem ().Set (reflect .ValueOf (v ).Elem ())
192- return true
193- }
194- return false
195- }
196-
197182// importPackageFact implements Pass.ImportPackageFact.
198183// Given a non-nil pointer ptr of type *T, where *T satisfies Fact,
199184// fact copies the fact value to *ptr.
Original file line number Diff line number Diff line change @@ -14,6 +14,22 @@ import (
1414 "golang.org/x/tools/go/analysis"
1515)
1616
17+ // NOTE(ldez) altered: logger; `act.factType`
18+ // importObjectFact implements Pass.ImportObjectFact.
19+ // Given a non-nil pointer ptr of type *T, where *T satisfies Fact,
20+ // importObjectFact copies the fact value to *ptr.
21+ func (act * action ) importObjectFact (obj types.Object , ptr analysis.Fact ) bool {
22+ if obj == nil {
23+ panic ("nil object" )
24+ }
25+ key := objectFactKey {obj , act .factType (ptr )}
26+ if v , ok := act .objectFacts [key ]; ok {
27+ reflect .ValueOf (ptr ).Elem ().Set (reflect .ValueOf (v ).Elem ())
28+ return true
29+ }
30+ return false
31+ }
32+
1733// NOTE(ldez) altered: removes code related to `act.pass.ExportPackageFact`; logger; `act.factType`.
1834// exportObjectFact implements Pass.ExportObjectFact.
1935func (act * action ) exportObjectFact (obj types.Object , fact analysis.Fact ) {
You can’t perform that action at this time.
0 commit comments