From 7097c81a6934165316b6d0e08cdd47504af5179b Mon Sep 17 00:00:00 2001 From: Geon Kim Date: Sun, 12 Nov 2023 17:00:25 +0900 Subject: [PATCH] chore(memlimit): Rename cap function to not shadow built-in cap --- memlimit/memlimit.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/memlimit/memlimit.go b/memlimit/memlimit.go index 644902e..dbb4d1c 100644 --- a/memlimit/memlimit.go +++ b/memlimit/memlimit.go @@ -155,12 +155,12 @@ func setGoMemLimit(provider Provider) (int64, error) { if err != nil { return 0, err } - capped := cap(limit) + capped := cappedU64ToI64(limit) debug.SetMemoryLimit(capped) return capped, nil } -func cap(limit uint64) int64 { +func cappedU64ToI64(limit uint64) int64 { if limit > math.MaxInt64 { return math.MaxInt64 }