go/token: remove unreachable code

Reported by go vet.

Change-Id: I6a6a636c79923fafd8c649c583383cdf455c6ce2
Reviewed-on: https://go-review.googlesource.com/c/go/+/678317
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Michael Pratt 2025-06-03 13:08:06 -04:00 committed by Gopher Robot
parent 0c0094c893
commit 74b70eead7

View file

@ -325,7 +325,9 @@ func (t *tree) set(file *File, pos **node, parent *node) {
// This code path isn't currently needed
// because FileSet never updates an existing entry.
// Remove this assertion if things change.
panic("unreachable according to current FileSet requirements")
if true {
panic("unreachable according to current FileSet requirements")
}
x.file = file
return
}
@ -344,7 +346,9 @@ func (t *tree) delete(pos **node) {
// This code path isn't currently needed because FileSet
// only calls delete after a positive locate.
// Remove this assertion if things change.
panic("unreachable according to current FileSet requirements")
if true {
panic("unreachable according to current FileSet requirements")
}
return
case x.left == nil: