File tree 3 files changed +39
-9
lines changed
3 files changed +39
-9
lines changed Original file line number Diff line number Diff line change @@ -121,15 +121,7 @@ func (lp *loadingPackage) loadFromSource(loadMode LoadMode) error {
121
121
122
122
pkg .IllTyped = true
123
123
124
- pkg .TypesInfo = & types.Info {
125
- Types : make (map [ast.Expr ]types.TypeAndValue ),
126
- Instances : make (map [* ast.Ident ]types.Instance ),
127
- Defs : make (map [* ast.Ident ]types.Object ),
128
- Uses : make (map [* ast.Ident ]types.Object ),
129
- Implicits : make (map [ast.Node ]types.Object ),
130
- Scopes : make (map [ast.Node ]* types.Scope ),
131
- Selections : make (map [* ast.SelectorExpr ]* types.Selection ),
132
- }
124
+ pkg .TypesInfo = newTypesInfo ()
133
125
134
126
importer := func (path string ) (* types.Package , error ) {
135
127
if path == unsafePkgName {
Original file line number Diff line number Diff line change
1
+ //go:build go1.17 && !go1.18
2
+ // +build go1.17,!go1.18
3
+
4
+ package goanalysis
5
+
6
+ import (
7
+ "go/ast"
8
+ "go/types"
9
+ )
10
+
11
+ func newTypesInfo () * types.Info {
12
+ return & types.Info {
13
+ Types : make (map [ast.Expr ]types.TypeAndValue ),
14
+ Instances : make (map [* ast.Ident ]types.Instance ),
15
+ Defs : make (map [* ast.Ident ]types.Object ),
16
+ Uses : make (map [* ast.Ident ]types.Object ),
17
+ Implicits : make (map [ast.Node ]types.Object ),
18
+ Scopes : make (map [ast.Node ]* types.Scope ),
19
+ Selections : make (map [* ast.SelectorExpr ]* types.Selection ),
20
+ }
21
+ }
Original file line number Diff line number Diff line change
1
+ package goanalysis
2
+
3
+ import (
4
+ "go/ast"
5
+ "go/types"
6
+ )
7
+
8
+ func newTypesInfo () * types.Info {
9
+ return & types.Info {
10
+ Types : make (map [ast.Expr ]types.TypeAndValue ),
11
+ Defs : make (map [* ast.Ident ]types.Object ),
12
+ Uses : make (map [* ast.Ident ]types.Object ),
13
+ Implicits : make (map [ast.Node ]types.Object ),
14
+ Scopes : make (map [ast.Node ]* types.Scope ),
15
+ Selections : make (map [* ast.SelectorExpr ]* types.Selection ),
16
+ }
17
+ }
You can’t perform that action at this time.
0 commit comments