diff --git a/vendor/gopkg.in/Acconut/lockfile.v1/lockfile.go b/vendor/gopkg.in/Acconut/lockfile.v1/lockfile.go index bb5c221..6240dbf 100644 --- a/vendor/gopkg.in/Acconut/lockfile.v1/lockfile.go +++ b/vendor/gopkg.in/Acconut/lockfile.v1/lockfile.go @@ -82,8 +82,10 @@ func (l Lockfile) TryLock() error { if err != nil { return err } else { - defer tmplock.Close() - defer os.Remove(tmplock.Name()) + defer func(){ + tmplock.Close() + os.Remove(tmplock.Name()) + }() } _, err = tmplock.WriteString(fmt.Sprintf("%d\n", os.Getpid()))