mirror of
https://github.com/rclone/rclone
synced 2024-11-27 05:23:40 +01:00
staticcheck: should use a simple channel send/receive instead of select with a single case
This commit is contained in:
parent
9612ca6110
commit
92a43c5f7b
@ -107,22 +107,18 @@ var shortFn = func(ctx context.Context, in rc.Params) (rc.Params, error) {
|
||||
}
|
||||
|
||||
var ctxFn = func(ctx context.Context, in rc.Params) (rc.Params, error) {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
<-ctx.Done()
|
||||
return nil, ctx.Err()
|
||||
}
|
||||
}
|
||||
|
||||
var ctxParmFn = func(paramCtx context.Context, returnError bool) func(ctx context.Context, in rc.Params) (rc.Params, error) {
|
||||
return func(ctx context.Context, in rc.Params) (rc.Params, error) {
|
||||
select {
|
||||
case <-paramCtx.Done():
|
||||
<-paramCtx.Done()
|
||||
if returnError {
|
||||
return nil, ctx.Err()
|
||||
}
|
||||
return rc.Params{}, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const (
|
||||
|
Loading…
Reference in New Issue
Block a user