Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

staticcheck: should use a simple channel send/receive instead of select with a single case

albertony92a43c5f7b55
diff --git a/fs/rc/jobs/job_test.go b/fs/rc/jobs/job_test.go
index 3fcd4530b..cb92e602a 100644
--- a/fs/rc/jobs/job_test.go
+++ b/fs/rc/jobs/job_test.go
@@ -107,21 +107,17 @@ 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():
- return nil, ctx.Err()
- }
+ <-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():
- if returnError {
- return nil, ctx.Err()
- }
- return rc.Params{}, nil
+ <-paramCtx.Done()
+ if returnError {
+ return nil, ctx.Err()
}
+ return rc.Params{}, nil
}
}