File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,7 @@ func (cl ContextLoader) loadPackages(ctx context.Context, loadMode packages.Load
237237 return retPkgs , nil
238238}
239239
240+ //nolint:gocyclo
240241func (cl ContextLoader ) Load (ctx context.Context , linters []linter.Config ) (* linter.Context , error ) {
241242 loadMode := cl .findLoadMode (linters )
242243 pkgs , err := cl .loadPackages (ctx , loadMode )
@@ -256,6 +257,21 @@ func (cl ContextLoader) Load(ctx context.Context, linters []linter.Config) (*lin
256257 var ssaProg * ssa.Program
257258 if loadMode == packages .LoadAllSyntax {
258259 ssaProg = cl .buildSSAProgram (pkgs )
260+ for _ , pkginfo := range prog .InitialPackages () {
261+ if pkginfo == nil {
262+ cl .log .Infof ("Pkginfo is nil" )
263+ continue
264+ }
265+ if pkginfo .Pkg == nil {
266+ cl .log .Infof ("Pkg %#v: types package is nil" , * pkginfo )
267+ continue
268+ }
269+ ssaPkg := ssaProg .Package (pkginfo .Pkg )
270+ if ssaPkg == nil {
271+ cl .log .Infof ("Pkg %#v: ssaPkg is nil: %#v" , * pkginfo , * pkginfo .Pkg )
272+ continue
273+ }
274+ }
259275 }
260276
261277 astLog := cl .log .Child ("astcache" )
You can’t perform that action at this time.
0 commit comments