Skip to content

Commit

Permalink
chore: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Jun 26, 2024
1 parent db2321a commit 23e78e0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion flock_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

func Test(t *testing.T) {
tmpFileFh, err := os.CreateTemp(os.TempDir(), "go-flock-")
tmpFileFh, _ := os.CreateTemp(os.TempDir(), "go-flock-")
tmpFileFh.Close()
tmpFile := tmpFileFh.Name()
os.Remove(tmpFile)
Expand Down
16 changes: 8 additions & 8 deletions flock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (t *TestSuite) SetUpTest(c *C) {
}

func (t *TestSuite) TearDownTest(c *C) {
t.flock.Unlock()
_ = t.flock.Unlock()
os.Remove(t.path)
}

Expand Down Expand Up @@ -130,9 +130,9 @@ func (t *TestSuite) TestFlock_TryRLock(c *C) {

// make sure we just return false with no error in cases
// where we would have been blocked
t.flock.Unlock()
flock2.Unlock()
t.flock.Lock()
_ = t.flock.Unlock()
_ = flock2.Unlock()
_ = t.flock.Lock()
locked, err = flock.New(t.path).TryRLock()
c.Assert(err, IsNil)
c.Check(locked, Equals, false)
Expand Down Expand Up @@ -173,8 +173,8 @@ func (t *TestSuite) TestFlock_TryRLockContext(c *C) {
c.Check(locked, Equals, false)

// timeout
t.flock.Unlock()
t.flock.Lock()
_ = t.flock.Unlock()
_ = t.flock.Lock()
ctx, cancel = context.WithTimeout(context.Background(), 10*time.Millisecond)
defer cancel()
locked, err = flock.New(t.path).TryRLockContext(ctx, time.Second)
Expand Down Expand Up @@ -224,7 +224,7 @@ func (t *TestSuite) TestFlock_Lock(c *C) {
//
ch := make(chan error, 2)
gf := flock.New(t.path)
defer gf.Unlock()
defer func() { _ = gf.Unlock() }()

go func(ch chan<- error) {
ch <- nil
Expand Down Expand Up @@ -268,7 +268,7 @@ func (t *TestSuite) TestFlock_RLock(c *C) {
//
ch := make(chan error, 2)
gf := flock.New(t.path)
defer gf.Unlock()
defer func() { _ = gf.Unlock() }()

go func(ch chan<- error) {
ch <- nil
Expand Down

0 comments on commit 23e78e0

Please sign in to comment.