From f17b28de78e7b2debd555f84a0e48be010e4fc88 Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Mon, 15 Apr 2024 19:54:01 -0400 Subject: [PATCH] runtime: remove no-op slice operation in Caller rpc was an array prior to CL 152537, so it was necessary to slice it since callers accepts a slice. Now that rpc is already a slice, slicing it is no longer required. Change-Id: Ie646ef5e494323c9fb58f3a24f942e3b1ff639ea Reviewed-on: https://go-review.googlesource.com/c/go/+/579016 Reviewed-by: Keith Randall Reviewed-by: Keith Randall LUCI-TryBot-Result: Go LUCI Auto-Submit: Dmitri Shuralyov Reviewed-by: Dmitri Shuralyov --- src/runtime/extern.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/extern.go b/src/runtime/extern.go index 9a02e36829..bb2f03b1ce 100644 --- a/src/runtime/extern.go +++ b/src/runtime/extern.go @@ -297,7 +297,7 @@ import ( // call. The boolean ok is false if it was not possible to recover the information. func Caller(skip int) (pc uintptr, file string, line int, ok bool) { rpc := make([]uintptr, 1) - n := callers(skip+1, rpc[:]) + n := callers(skip+1, rpc) if n < 1 { return } -- 2.48.1