Change-Id: I7cbbe3b9a9f08ac98e3e76be7bda2f7df9c61fb3
Reviewed-on: https://go-review.googlesource.com/c/go/+/617915
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
// It is only for runtime functions, so ASCII A-Z is fine.
func isExportedRuntime(name string) bool {
// Check and remove package qualifier.
- n := len("runtime.")
- if len(name) <= n || name[:n] != "runtime." {
+ name, found := stringslite.CutPrefix(name, "runtime.")
+ if !found {
return false
}
- name = name[n:]
rcvr := ""
// Extract receiver type, if any.