diff --git a/go/tools/builders/nogo_main.go b/go/tools/builders/nogo_main.go index 767aa3b5..fbd13082 100644 --- a/go/tools/builders/nogo_main.go +++ b/go/tools/builders/nogo_main.go @@ -386,7 +386,11 @@ func checkAnalysisResults(actions []*action, pkg *goPackage) string { } // Discard diagnostics based on the analyzer configuration. for _, d := range act.diagnostics { - filename := pkg.fset.File(d.Pos).Name() + file := pkg.fset.File(d.Pos) + if file == nil { + continue + } + filename := file.Name() include := true if len(config.onlyFiles) > 0 { // This analyzer emits diagnostics for only a set of files.