1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-29 17:41:15 +03:00

Fix defer order.

This commit is contained in:
Vladimir Mihailenco
2017-01-28 10:53:10 +02:00
parent 9cd4965689
commit 308ebee457
4 changed files with 25 additions and 20 deletions

View File

@ -61,8 +61,8 @@ func (c *Pipeline) discard() error {
// Exec always returns list of commands and error of the first failed
// command if any.
func (c *Pipeline) Exec() ([]Cmder, error) {
defer c.mu.Unlock()
c.mu.Lock()
defer c.mu.Unlock()
if c.closed {
return nil, pool.ErrClosed