| 1 |
In addition to the Diagnostic, the SA4023 analyzer reports a |
| 2 |
RelatedInformation at the position of b.B, in an another package. |
| 3 |
Since this is in a dependency package, we cannot resolve to |
| 4 |
protocol.Location coordinates. This used to trigger an assertion, but |
| 5 |
now we resolve the location approximately. |
| 6 |
|
| 7 |
This is a regression test for #70791. |
| 8 |
|
| 9 |
-- settings.json -- |
| 10 |
{"analyses": {"SA4023": true}} |
| 11 |
|
| 12 |
-- go.mod -- |
| 13 |
module example.com |
| 14 |
go 1.18 |
| 15 |
|
| 16 |
-- a/a.go -- |
| 17 |
package a |
| 18 |
|
| 19 |
import "example.com/b" |
| 20 |
|
| 21 |
var _ = b.B() == nil //@ diag("b.B", re"comparison is never true") |
| 22 |
|
| 23 |
-- b/b.go -- |
| 24 |
package b |
| 25 |
|
| 26 |
func B() any { return (*int)(nil) } |
| 27 |
|
| 28 |
|
| 29 |
|