Skip to content

Commit

Permalink
proper lock file close #139 (#140)
Browse files Browse the repository at this point in the history
Signed-off-by: Denis Vaumoron <dvaumoron@gmail.com>
  • Loading branch information
dvaumoron authored May 23, 2024
1 parent 23e8242 commit d8ca331
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/lockfile/lockfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ const (
func Write(dirPath string, displayer loghelper.Displayer) func() {
lockPath := filepath.Join(dirPath, ".lock")
for logLevel := hclog.Warn; true; logLevel = hclog.Info {
_, err := os.OpenFile(lockPath, os.O_CREATE|os.O_EXCL, 0644) //nolint
f, err := os.OpenFile(lockPath, os.O_CREATE|os.O_EXCL, 0644) //nolint
if err == nil {
f.Close()
break
}

Expand Down

0 comments on commit d8ca331

Please sign in to comment.