mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
Run staticcheck on CI (#16170)
This commit is contained in:
@@ -40,6 +40,7 @@ func (ld sharedLock) backgroundRoutine(ctx context.Context, objAPI ObjectLayer,
|
||||
continue
|
||||
}
|
||||
|
||||
keepLock:
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
@@ -48,7 +49,7 @@ func (ld sharedLock) backgroundRoutine(ctx context.Context, objAPI ObjectLayer,
|
||||
// The context of the lock is canceled, this can happen
|
||||
// if one lock lost quorum due to cluster instability
|
||||
// in that case, try to lock again.
|
||||
break
|
||||
break keepLock
|
||||
case ld.lockContext <- lkctx:
|
||||
// Send the lock context to anyone asking for it
|
||||
}
|
||||
@@ -70,10 +71,8 @@ func mergeContext(ctx1, ctx2 context.Context) (context.Context, context.CancelFu
|
||||
}
|
||||
|
||||
func (ld sharedLock) GetLock(ctx context.Context) (context.Context, context.CancelFunc) {
|
||||
select {
|
||||
case l := <-ld.lockContext:
|
||||
return mergeContext(l.Context(), ctx)
|
||||
}
|
||||
l := <-ld.lockContext
|
||||
return mergeContext(l.Context(), ctx)
|
||||
}
|
||||
|
||||
func newSharedLock(ctx context.Context, objAPI ObjectLayer, lockName string) *sharedLock {
|
||||
|
||||
Reference in New Issue
Block a user