mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 19:15:34 +00:00
util/clientmetric: switch to TestHooks struct for test-only functions (#4632)
Followup to 7966aed1e0
to pick up
review feedback that was accidentally left out.
Signed-off-by: Mihai Parparita <mihai@tailscale.com>
This commit is contained in:
parent
7966aed1e0
commit
025867fd07
@ -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{}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user