]> Cypherpunks repositories - gostls13.git/commitdiff
go/token: remove unreachable code
authorMichael Pratt <mpratt@google.com>
Tue, 3 Jun 2025 17:08:06 +0000 (13:08 -0400)
committerGopher Robot <gobot@golang.org>
Tue, 3 Jun 2025 17:53:27 +0000 (10:53 -0700)
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>

src/go/token/tree.go

index eaa2b30ee5c2f0aa63f65588e5c0b6e5223d3112..2354ad0f330e1fa38e0ae96208b8d8da8c14352f 100644 (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: