From 088e60b8303832b524839c43e06f9d2a3c78bb12 Mon Sep 17 00:00:00 2001 From: Matt Jaffee Date: Wed, 15 Apr 2020 18:20:20 -0500 Subject: [PATCH] better defer that Unlock --- transaction.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transaction.go b/transaction.go index a38f30848..1cd6ccea9 100644 --- a/transaction.go +++ b/transaction.go @@ -166,7 +166,7 @@ func (tm *TransactionManager) finish(id string) (Transaction, error) { // if there isn't one. func (tm *TransactionManager) Get(id string) (Transaction, error) { tm.mu.RLock() - tm.mu.RUnlock() + defer tm.mu.RUnlock() return tm.store.Get(id) }