From 2c635b68fdc8ddf83208ed2ec65eff09a3af58b8 Mon Sep 17 00:00:00 2001 From: Jes Cok Date: Wed, 15 May 2024 02:37:41 +0800 Subject: runtime: make use of stringslite.{HasPrefix, HasSuffix} Change-Id: I7461a892e1591e3bad876f0a718a99e6de2c4659 Reviewed-on: https://go-review.googlesource.com/c/go/+/585435 Reviewed-by: Michael Knyszek LUCI-TryBot-Result: Go LUCI Reviewed-by: Dmitri Shuralyov --- src/runtime/panic.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/runtime/panic.go') 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) } -- cgit v1.3