github.com/prysmaticlabs/prysm@v1.4.4/third_party/io_bazel_rules_go.patch (about)

     1  diff --git a/go/tools/builders/nogo_main.go b/go/tools/builders/nogo_main.go
     2  index 2830a666..ce0e6e39 100644
     3  --- a/go/tools/builders/nogo_main.go
     4  +++ b/go/tools/builders/nogo_main.go
     5  @@ -386,13 +386,11 @@ func checkAnalysisResults(actions []*action, pkg *goPackage) string {
     6   		}
     7   		// Discard diagnostics based on the analyzer configuration.
     8   		for _, d := range act.diagnostics {
     9  -			// NOTE(golang.org/issue/31008): nilness does not set positions,
    10  -			// so don't assume the position is valid.
    11  -			f := pkg.fset.File(d.Pos)
    12  -			filename := "-"
    13  -			if f != nil {
    14  -				filename = f.Name()
    15  +			file := pkg.fset.File(d.Pos)
    16  +			if file == nil {
    17  +				continue
    18   			}
    19  +			filename := file.Name()
    20   			include := true
    21   			if len(config.onlyFiles) > 0 {
    22   				// This analyzer emits diagnostics for only a set of files.