From 5f2277624ae1a133f3e5ee64f7b298b868d81d66 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Fri, 28 Aug 2020 09:44:08 +0300 Subject: [PATCH] lib/{promscrape,leveledbytebufferpool}: rename getPoolIdAndCapacity to getPoolIDAndCapacity in order to make golint happy --- lib/leveledbytebufferpool/pool.go | 6 +++--- lib/promscrape/scrapework.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/leveledbytebufferpool/pool.go b/lib/leveledbytebufferpool/pool.go index 14416122e..59f660211 100644 --- a/lib/leveledbytebufferpool/pool.go +++ b/lib/leveledbytebufferpool/pool.go @@ -19,7 +19,7 @@ var pools [30]sync.Pool // Get returns byte buffer with the given capacity. func Get(capacity int) *bytesutil.ByteBuffer { - id, capacityNeeded := getPoolIdAndCapacity(capacity) + id, capacityNeeded := getPoolIDAndCapacity(capacity) for i := 0; i < 2; i++ { if id < 0 || id >= len(pools) { break @@ -37,12 +37,12 @@ func Get(capacity int) *bytesutil.ByteBuffer { // Put returns bb to the pool. func Put(bb *bytesutil.ByteBuffer) { capacity := cap(bb.B) - id, _ := getPoolIdAndCapacity(capacity) + id, _ := getPoolIDAndCapacity(capacity) bb.Reset() pools[id].Put(bb) } -func getPoolIdAndCapacity(size int) (int, int) { +func getPoolIDAndCapacity(size int) (int, int) { size-- if size < 0 { size = 0 diff --git a/lib/promscrape/scrapework.go b/lib/promscrape/scrapework.go index 1ccfee6ae..c918450bc 100644 --- a/lib/promscrape/scrapework.go +++ b/lib/promscrape/scrapework.go @@ -265,7 +265,7 @@ type leveledWriteRequestCtxPool struct { } func (lwp *leveledWriteRequestCtxPool) Get(labelsCapacity int) *writeRequestCtx { - id, capacityNeeded := lwp.getPoolIdAndCapacity(labelsCapacity) + id, capacityNeeded := lwp.getPoolIDAndCapacity(labelsCapacity) for i := 0; i < 2; i++ { if id < 0 || id >= len(lwp.pools) { break @@ -282,12 +282,12 @@ func (lwp *leveledWriteRequestCtxPool) Get(labelsCapacity int) *writeRequestCtx func (lwp *leveledWriteRequestCtxPool) Put(wc *writeRequestCtx) { capacity := cap(wc.labels) - id, _ := lwp.getPoolIdAndCapacity(capacity) + id, _ := lwp.getPoolIDAndCapacity(capacity) wc.reset() lwp.pools[id].Put(wc) } -func (lwp *leveledWriteRequestCtxPool) getPoolIdAndCapacity(size int) (int, int) { +func (lwp *leveledWriteRequestCtxPool) getPoolIDAndCapacity(size int) (int, int) { size-- if size < 0 { size = 0