From 76e7bfbb4e3a6114a33c7dba666fdd26698bedc5 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Wed, 14 May 2025 15:53:58 -0400 Subject: runtime: move atoi to internal/runtime/strconv Moving to a smaller package allows its use in other internal/runtime packages. This isn't internal/strconvlite since it can't be used directly by strconv. For #73193. Change-Id: I6a6a636c9c8b3f06b5fd6c07fe9dd5a7a37d1429 Reviewed-on: https://go-review.googlesource.com/c/go/+/672697 Reviewed-by: Michael Knyszek LUCI-TryBot-Result: Go LUCI Auto-Submit: Michael Pratt --- src/runtime/os_linux.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/runtime/os_linux.go') diff --git a/src/runtime/os_linux.go b/src/runtime/os_linux.go index f24d18027b..3071e32202 100644 --- a/src/runtime/os_linux.go +++ b/src/runtime/os_linux.go @@ -8,6 +8,7 @@ import ( "internal/abi" "internal/goarch" "internal/runtime/atomic" + "internal/runtime/strconv" "internal/runtime/syscall" "unsafe" ) @@ -341,7 +342,7 @@ func getHugePageSize() uintptr { return 0 } n-- // remove trailing newline - v, ok := atoi(slicebytetostringtmp((*byte)(ptr), int(n))) + v, ok := strconv.Atoi(slicebytetostringtmp((*byte)(ptr), int(n))) if !ok || v < 0 { v = 0 } -- cgit v1.3