Skip to content

Commit

Permalink
make linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
arriven committed Jul 31, 2022
1 parent 4e5dce8 commit 2581d3e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/utils/locker.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ type Locker struct {

func (m *Locker) Lock(key string) func() {
value, _ := m.mutexes.LoadOrStore(key, &sync.Mutex{})
mtx := value.(*sync.Mutex)
mtx.Lock()
mtx, ok := value.(*sync.Mutex)
if ok {
mtx.Lock()

return func() { mtx.Unlock() }
return func() { mtx.Unlock() }
}

return func() {}
}

0 comments on commit 2581d3e

Please sign in to comment.