From 14f901da6dc522e21f2d18dae2d798318ee6a2ef Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 5 Jul 2021 22:20:27 -0700 Subject: [PATCH] util/deephash: fix sync.Pool usage Whoops. From yesterday's 9ae3bd09394c8d41bc065fdf8856739b468f51f7 (not yet used by anything, fortunately) Signed-off-by: Brad Fitzpatrick --- util/deephash/deephash.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/deephash/deephash.go b/util/deephash/deephash.go index ac1c267c7..e3f0dfcf9 100644 --- a/util/deephash/deephash.go +++ b/util/deephash/deephash.go @@ -53,7 +53,7 @@ var hasherPool = &sync.Pool{ // Hash returns the raw SHA-256 hash of v. func Hash(v interface{}) [sha256.Size]byte { hasher := hasherPool.Get().(*hasher) - hasherPool.Put(hasher) + defer hasherPool.Put(hasher) return hasher.Hash(v) }