Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

Commit f1ea974

Browse files
committed
fix(lockx): fix testcase
fix(lockx): fix testcase
1 parent 9a1a352 commit f1ea974

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lock/filelock/filelock_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ func TestFileLock(t *testing.T) {
1919
if err != nil {
2020
t.Error(err)
2121
}
22-
defer flock.Unlock()
22+
defer func(flock *FileLock) {
23+
_ = flock.Unlock()
24+
}(flock)
2325

24-
f, _ := os.OpenFile("testdata/config", os.O_APPEND|os.O_WRONLY, 0666)
26+
f, _ := os.OpenFile("testdata/config", os.O_APPEND|os.O_WRONLY, 0o666)
2527
defer f.Close()
26-
f.WriteString("test" + cast.ToString(num) + "\n")
28+
_, _ = f.WriteString("test" + cast.ToString(num) + "\n")
2729
}(i)
2830
}
2931
wg.Wait()

0 commit comments

Comments
 (0)