mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
cleanup: use slices package
This commit replaces the user implemented function `CheckSliceContains()` with `slices.Contains()` function introduced in Go 1.21. Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
@ -21,6 +21,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"slices"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@ -363,7 +364,7 @@ func attachRBDImage(ctx context.Context, volOptions *rbdVolume, device string, c
|
||||
}
|
||||
|
||||
func appendNbdDeviceTypeAndOptions(cmdArgs []string, userOptions, cookie string) []string {
|
||||
isUnmap := util.CheckSliceContains(cmdArgs, "unmap")
|
||||
isUnmap := slices.Contains(cmdArgs, "unmap")
|
||||
if !isUnmap {
|
||||
if !strings.Contains(userOptions, useNbdNetlink) {
|
||||
cmdArgs = append(cmdArgs, "--"+useNbdNetlink)
|
||||
|
Reference in New Issue
Block a user