diff options
| author | Jes Cok <xigua67damn@gmail.com> | 2024-05-15 02:37:41 +0800 |
|---|---|---|
| committer | Michael Knyszek <mknyszek@google.com> | 2024-05-17 15:41:45 +0000 |
| commit | 2c635b68fdc8ddf83208ed2ec65eff09a3af58b8 (patch) | |
| tree | 39afcafd8f4d3e03a68334a53ab38c5dfe53250d /src/runtime/panic.go | |
| parent | d11e41728515aea6f7def4a279a3a2591fb18650 (diff) | |
| download | go-2c635b68fdc8ddf83208ed2ec65eff09a3af58b8.tar.xz | |
runtime: make use of stringslite.{HasPrefix, HasSuffix}
Change-Id: I7461a892e1591e3bad876f0a718a99e6de2c4659
Reviewed-on: https://go-review.googlesource.com/c/go/+/585435
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Diffstat (limited to 'src/runtime/panic.go')
| -rw-r--r-- | src/runtime/panic.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/runtime/panic.go b/src/runtime/panic.go index ff9c64113f..58d13b6adb 100644 --- a/src/runtime/panic.go +++ b/src/runtime/panic.go @@ -8,6 +8,7 @@ import ( "internal/abi" "internal/goarch" "internal/runtime/atomic" + "internal/stringslite" "runtime/internal/sys" "unsafe" ) @@ -53,7 +54,7 @@ const ( // pc should be the program counter of the compiler-generated code that // triggered this panic. func panicCheck1(pc uintptr, msg string) { - if goarch.IsWasm == 0 && hasPrefix(funcname(findfunc(pc)), "runtime.") { + if goarch.IsWasm == 0 && stringslite.HasPrefix(funcname(findfunc(pc)), "runtime.") { // Note: wasm can't tail call, so we can't get the original caller's pc. throw(msg) } |
