Skip to content

Commit 4faf573

Browse files
committed
gopls/internal/test/marker: fix reachable panic("unreachable")
Instead, report an informative error. (Found while investigating golang/go#61496.) Updates golang/go#61496 Change-Id: I242603fcd598b1fd119bb22c7995cb6b978543ab Reviewed-on: https://go-review.googlesource.com/c/tools/+/689475 Reviewed-by: Madeline Kalil <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 2bcc4d2 commit 4faf573

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gopls/internal/test/marker/marker_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2142,7 +2142,8 @@ func codeActionMarker(mark marker, loc protocol.Location, kind string) {
21422142

21432143
if end := namedArgFunc(mark, "end", convertNamedArgLocation, protocol.Location{}); end.URI != "" {
21442144
if end.URI != loc.URI {
2145-
panic("unreachable")
2145+
mark.errorf("end marker is in a different file (%s)", filepath.Base(loc.URI.Path()))
2146+
return
21462147
}
21472148
loc.Range.End = end.Range.End
21482149
}

0 commit comments

Comments
 (0)