Run staticcheck on CI (#16170)

This commit is contained in:
Klaus Post
2022-12-05 20:18:50 +01:00
committed by GitHub
parent a9f5b58a01
commit a713aee3d5
24 changed files with 140 additions and 162 deletions

View File

@@ -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 {