| 1 | // Copyright 2024 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | // This file contains declarations needed for compatibility with resolver.go |
| 6 | // copied from GOROOT. |
| 7 | |
| 8 | package parsego |
| 9 | |
| 10 | import "go/token" |
| 11 | |
| 12 | // assert panics with the given msg if cond is not true. |
| 13 | func assert(cond bool, msg string) { |
| 14 | if !cond { |
| 15 | panic(msg) |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | // A bailout panic is raised to indicate early termination. pos and msg are |
| 20 | // only populated when bailing out of object resolution. |
| 21 | type bailout struct { |
| 22 | pos token.Pos |
| 23 | msg string |
| 24 | } |