Skip to content

Commit

Permalink
deps: accelerator: remove deps
Browse files Browse the repository at this point in the history
golang 1.21.z already features `slices.Contains`
(see: https://pkg.go.dev/[email protected]#Contains)
so we can use the stdlib instead of adding a depenency
just for a single function.
No intended change in behavior.

Signed-off-by: Francesco Romani <[email protected]>
  • Loading branch information
ffromani committed Mar 3, 2025
1 parent 8f0a31c commit 7acebef
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/samber/lo v1.47.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/sys v0.1.0 // indirect
golang.org/x/text v0.16.0 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
)
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,13 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/samber/lo v1.47.0 h1:z7RynLwP5nbyRscyvcD043DWYoOcYRv3mV8lBeqOCLc=
github.com/samber/lo v1.47.0/go.mod h1:RmDH9Ct32Qy3gduHQuKJ3gW1fMHAnE/fAzQuf6He5cU=
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
4 changes: 2 additions & 2 deletions pkg/accelerator/accelerator_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
package accelerator

import (
"github.com/samber/lo"
"slices"

Check failure on line 9 in pkg/accelerator/accelerator_linux.go

View workflow job for this annotation

GitHub Actions / ubuntu-2004 (1.18)

package slices is not in GOROOT (/opt/hostedtoolcache/go/1.18.10/x64/src/slices)

Check failure on line 9 in pkg/accelerator/accelerator_linux.go

View workflow job for this annotation

GitHub Actions / ubuntu-2004 (1.19)

package slices is not in GOROOT (/opt/hostedtoolcache/go/1.19.13/x64/src/slices)

"github.com/jaypipes/ghw/pkg/context"
"github.com/jaypipes/ghw/pkg/pci"
Expand Down Expand Up @@ -48,7 +48,7 @@ func (i *Info) load() error {
class := dev.Class.ID
subclass := dev.Subclass.ID
if subclasses, ok := acceleratorPCIClasses[class]; ok {
if lo.Contains(subclasses, subclass) {
if slices.Contains(subclasses, subclass) {
return true
}
}
Expand Down

0 comments on commit 7acebef

Please sign in to comment.