mirror of https://github.com/golang/go.git
This change ensures that the End position provided to span.NewRange in suggestedAnalysisFixes is valid even when the diagnostic has only a valid start position. This seems to be the cause of some panics observed in the ARM builders in the attached issue. Also, reduce the scope of the recover operation to just the analyzer's run method: we don't want to hide further bugs (or discard stack traces) in the setup or postprocessing logic. Also: - split a single assertion in span.NewRange into two. - Add information to various error messages to help identify causes. - Add TODO comments about inconsistent treatment of token.File in span.FileSpan, and temporarily remove bug.Errorf that is obviously reachable from valid inputs. - Add TODO to fix another panic in an analyzer that is covered by our tests but was hitherto suppressed. - Add TODO to use bug.Errorf after recover to prevent recurrences. We can't do that until the previous panic is fixed. Updates https://github.com/golang/go/issues/54655 Change-Id: I0576d03fcfffe0c8df157cf6c6520c9d402f8803 Reviewed-on: https://go-review.googlesource.com/c/tools/+/425356 Run-TryBot: Alan Donovan <adonovan@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Suzy Mueller <suzmue@golang.org> |
||
|---|---|---|
| .. | ||
| parse.go | ||
| span.go | ||
| span_test.go | ||
| token.go | ||
| token_test.go | ||
| uri.go | ||
| uri_test.go | ||
| uri_windows_test.go | ||
| utf16.go | ||
| utf16_test.go | ||