From ae190fc10d381252f70b1ad1032d69181a41abdf Mon Sep 17 00:00:00 2001 From: Boris Kozlov Date: Thu, 20 Jul 2023 19:33:42 +0200 Subject: [PATCH] Added godoc to hero pool constr --- module/mempool/herocache/backdata/heropool/pool.go | 2 ++ module/mempool/herocache/backdata/heropool/pool_test.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/module/mempool/herocache/backdata/heropool/pool.go b/module/mempool/herocache/backdata/heropool/pool.go index 05595481eef..87e21abb33e 100644 --- a/module/mempool/herocache/backdata/heropool/pool.go +++ b/module/mempool/herocache/backdata/heropool/pool.go @@ -70,6 +70,8 @@ type Pool struct { ejectionMode EjectionMode } +// NewHeroPool returns a pointer to a new hero pool constructed based on a provided EjectionMode, +// logger and a provided fixed size. func NewHeroPool(sizeLimit uint32, ejectionMode EjectionMode, logger zerolog.Logger) *Pool { l := &Pool{ free: state{ diff --git a/module/mempool/herocache/backdata/heropool/pool_test.go b/module/mempool/herocache/backdata/heropool/pool_test.go index b84d170ec93..5cc19609753 100644 --- a/module/mempool/herocache/backdata/heropool/pool_test.go +++ b/module/mempool/herocache/backdata/heropool/pool_test.go @@ -264,7 +264,7 @@ func testAddRemoveEntities(t *testing.T, limit uint32, entityCount uint32, eject randomIntN := func(length int) int { random, err := rand.Uintn(uint(length)) - require.Nil(t, err) + require.NoError(t, err) return int(random) }