File tree Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -16,9 +16,7 @@ require (
16
16
github.com/inconshreveable/mousetrap v1.1.0 // indirect
17
17
github.com/kr/pretty v0.1.0 // indirect
18
18
github.com/mitchellh/go-homedir v1.1.0 // indirect
19
- github.com/samber/lo v1.47.0 // indirect
20
19
github.com/spf13/pflag v1.0.5 // indirect
21
20
golang.org/x/sys v0.1.0 // indirect
22
- golang.org/x/text v0.16.0 // indirect
23
21
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
24
22
)
Original file line number Diff line number Diff line change @@ -19,17 +19,13 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk
19
19
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4 =
20
20
github.com/pkg/errors v0.9.1 /go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0 =
21
21
github.com/russross/blackfriday/v2 v2.1.0 /go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM =
22
- github.com/samber/lo v1.47.0 h1:z7RynLwP5nbyRscyvcD043DWYoOcYRv3mV8lBeqOCLc =
23
- github.com/samber/lo v1.47.0 /go.mod h1:RmDH9Ct32Qy3gduHQuKJ3gW1fMHAnE/fAzQuf6He5cU =
24
22
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0 =
25
23
github.com/spf13/cobra v1.8.0 /go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho =
26
24
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA =
27
25
github.com/spf13/pflag v1.0.5 /go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg =
28
26
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 /go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs =
29
27
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U =
30
28
golang.org/x/sys v0.1.0 /go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg =
31
- golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4 =
32
- golang.org/x/text v0.16.0 /go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI =
33
29
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 /go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0 =
34
30
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY =
35
31
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 /go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0 =
Original file line number Diff line number Diff line change 6
6
package accelerator
7
7
8
8
import (
9
- "github.com/samber/lo"
10
-
11
9
"github.com/jaypipes/ghw/pkg/context"
12
10
"github.com/jaypipes/ghw/pkg/pci"
13
11
)
@@ -48,7 +46,7 @@ func (i *Info) load() error {
48
46
class := dev .Class .ID
49
47
subclass := dev .Subclass .ID
50
48
if subclasses , ok := acceleratorPCIClasses [class ]; ok {
51
- if lo . Contains (subclasses , subclass ) {
49
+ if slicesContains (subclasses , subclass ) {
52
50
return true
53
51
}
54
52
}
@@ -70,3 +68,13 @@ func (i *Info) load() error {
70
68
i .Devices = accelDevices
71
69
return nil
72
70
}
71
+
72
+ // TODO: delete and just use slices.Contains when the minimal golang version we support is 1.21
73
+ func slicesContains (s []string , v string ) bool {
74
+ for i := range s {
75
+ if v == s [i ] {
76
+ return true
77
+ }
78
+ }
79
+ return false
80
+ }
You can’t perform that action at this time.
0 commit comments