File tree 2 files changed +16
-19
lines changed
2 files changed +16
-19
lines changed Original file line number Diff line number Diff line change @@ -2,12 +2,8 @@ package goanalysis
2
2
3
3
import (
4
4
"fmt"
5
- "go/types"
6
- "reflect"
7
5
"runtime/debug"
8
6
9
- "golang.org/x/tools/go/analysis"
10
-
11
7
"github.com/golangci/golangci-lint/internal/errorutil"
12
8
)
13
9
@@ -58,21 +54,6 @@ func (act *action) analyzeSafe() {
58
54
act .r .sw .TrackStage (act .a .Name , act .analyze )
59
55
}
60
56
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
-
76
57
func (act * action ) markDepsForAnalyzingSource () {
77
58
// Horizontal deps (analyzer.Requires) must be loaded from source and analyzed before analyzing
78
59
// this action.
Original file line number Diff line number Diff line change @@ -301,6 +301,22 @@ func (act *action) allObjectFacts() []analysis.ObjectFact {
301
301
return out
302
302
}
303
303
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
+
304
320
// NOTE(ldez) altered: removes code related to `act.pass.ExportPackageFact`; logger; `act.factType`.
305
321
// exportPackageFact implements Pass.ExportPackageFact.
306
322
func (act * action ) exportPackageFact (fact analysis.Fact ) {
You can’t perform that action at this time.
0 commit comments