util/clientmetric: switch to TestHooks struct for test-only functions
Followup to to pick up
review feedback that was accidentally left out.
@@ -255,10 +255,6 @@ func EncodeLogTailMetricsDelta() string {
return enc.buf.String()
}
-func ResetLastDeltaForTest() {
- lastDelta = time.Time{}
-}
-
var deltaPool = &sync.Pool{
New: func() any {
return new(deltaEncBuf)
@@ -308,3 +304,11 @@ func (b *deltaEncBuf) writeHexVarint(v int64) {
hex.Encode(hexBuf, b.scratch[:n])
b.buf.Write(hexBuf)
}
+
+var TestHooks testHooks
+
+type testHooks struct{}
+
+func (testHooks) ResetLastDelta() {
+ lastDelta = time.Time{}
+}
