File tree Expand file tree Collapse file tree 2 files changed +16
-19
lines changed Expand file tree Collapse file tree 2 files changed +16
-19
lines changed Original file line number Diff line number Diff line change @@ -2,12 +2,8 @@ package goanalysis
22
33import (
44 "fmt"
5- "go/types"
6- "reflect"
75 "runtime/debug"
86
9- "golang.org/x/tools/go/analysis"
10-
117 "github.com/golangci/golangci-lint/internal/errorutil"
128)
139
@@ -58,21 +54,6 @@ func (act *action) analyzeSafe() {
5854 act .r .sw .TrackStage (act .a .Name , act .analyze )
5955}
6056
61- // importPackageFact implements Pass.ImportPackageFact.
62- // Given a non-nil pointer ptr of type *T, where *T satisfies Fact,
63- // fact copies the fact value to *ptr.
64- func (act * action ) importPackageFact (pkg * types.Package , ptr analysis.Fact ) bool {
65- if pkg == nil {
66- panic ("nil package" )
67- }
68- key := packageFactKey {pkg , act .factType (ptr )}
69- if v , ok := act .packageFacts [key ]; ok {
70- reflect .ValueOf (ptr ).Elem ().Set (reflect .ValueOf (v ).Elem ())
71- return true
72- }
73- return false
74- }
75-
7657func (act * action ) markDepsForAnalyzingSource () {
7758 // Horizontal deps (analyzer.Requires) must be loaded from source and analyzed before analyzing
7859 // this action.
Original file line number Diff line number Diff line change @@ -301,6 +301,22 @@ func (act *action) allObjectFacts() []analysis.ObjectFact {
301301 return out
302302}
303303
304+ // NOTE(ldez) altered: `act.factType`
305+ // importPackageFact implements Pass.ImportPackageFact.
306+ // Given a non-nil pointer ptr of type *T, where *T satisfies Fact,
307+ // fact copies the fact value to *ptr.
308+ func (act * action ) importPackageFact (pkg * types.Package , ptr analysis.Fact ) bool {
309+ if pkg == nil {
310+ panic ("nil package" )
311+ }
312+ key := packageFactKey {pkg , act .factType (ptr )}
313+ if v , ok := act .packageFacts [key ]; ok {
314+ reflect .ValueOf (ptr ).Elem ().Set (reflect .ValueOf (v ).Elem ())
315+ return true
316+ }
317+ return false
318+ }
319+
304320// NOTE(ldez) altered: removes code related to `act.pass.ExportPackageFact`; logger; `act.factType`.
305321// exportPackageFact implements Pass.ExportPackageFact.
306322func (act * action ) exportPackageFact (fact analysis.Fact ) {
You can’t perform that action at this time.
0 commit comments