Skip to content

Commit 44935b5

Browse files
committed
Fixed go compatibility
1 parent b0fd012 commit 44935b5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

command/device/list.go

+10-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ package device
2020
import (
2121
"context"
2222
"fmt"
23-
"slices"
2423
"strings"
2524

2625
"github.com/arduino/arduino-cloud-cli/config"
@@ -56,7 +55,7 @@ func List(ctx context.Context, params *ListParams, cred *config.Credentials) ([]
5655

5756
var devices []DeviceInfo
5857
for _, foundDev := range foundDevices {
59-
if len(deviceIdFilter) > 0 && !slices.Contains(deviceIdFilter, foundDev.Id) {
58+
if len(deviceIdFilter) > 0 && !sliceContains(deviceIdFilter, foundDev.Id) {
6059
continue
6160
}
6261
dev, err := getDeviceInfo(&foundDev)
@@ -68,3 +67,12 @@ func List(ctx context.Context, params *ListParams, cred *config.Credentials) ([]
6867

6968
return devices, nil
7069
}
70+
71+
func sliceContains(s []string, v string) bool {
72+
for i := range s {
73+
if v == s[i] {
74+
return true
75+
}
76+
}
77+
return false
78+
}

0 commit comments

Comments
 (0)