mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
cleanup: address golangci 'usetesting' linter issues
When a context.Context is needed in a unit test, t.Context() should be used instead of creating a new one with context.TODO() or context.Background(). Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
committed by
mergify[bot]
parent
be5462cf62
commit
457ffe884a
@ -17,7 +17,6 @@ limitations under the License.
|
||||
package rbd
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"os"
|
||||
"strings"
|
||||
@ -249,7 +248,7 @@ func TestGetCephClientLogFileName(t *testing.T) {
|
||||
|
||||
func TestStrategicActionOnLogFile(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx := context.TODO()
|
||||
ctx := t.Context()
|
||||
tmpDir := t.TempDir()
|
||||
|
||||
var logFile [3]string
|
||||
@ -320,7 +319,7 @@ func TestStrategicActionOnLogFile(t *testing.T) {
|
||||
|
||||
func TestIsKrbdFeatureSupported(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx := context.TODO()
|
||||
ctx := t.Context()
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
|
Reference in New Issue
Block a user