Skip to content

Commit 356014a

Browse files
ibrokethecloudinnobead
authored andcommitted
update to go v1.23 and golangci-lint
1 parent f40c93a commit 356014a

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

Dockerfile.dapper

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM registry.suse.com/bci/golang:1.22.7
1+
FROM registry.suse.com/bci/golang:1.23
22

33
ARG DAPPER_HOST_ARCH
44
ENV ARCH $DAPPER_HOST_ARCH
@@ -15,7 +15,7 @@ RUN export K8S_VERSION=1.24.2 && \
1515
tar -C /usr/local/kubebuilder --strip-components=1 -zvxf envtest-bins.tar.gz
1616

1717
## install golangci
18-
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.57.1
18+
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.63.4
1919

2020
# The docker version in dapper is too old to have buildx. Install it manually.
2121
RUN curl -sSfL https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-${ARCH} -o buildx-v0.13.1.linux-${ARCH} && \

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/harvester/pcidevices
22

3-
go 1.22.7
3+
go 1.23.4
44

55
require (
66
github.com/evanphx/json-patch v5.6.0+incompatible
@@ -155,7 +155,7 @@ require (
155155
golang.org/x/net v0.21.0
156156
golang.org/x/oauth2 v0.13.0 // indirect
157157
golang.org/x/sync v0.5.0 // indirect
158-
golang.org/x/sys v0.18.0 // indirect
158+
golang.org/x/sys v0.18.0
159159
golang.org/x/term v0.18.0 // indirect
160160
golang.org/x/text v0.14.0 // indirect
161161
golang.org/x/time v0.3.0 // indirect

pkg/controller/usbdevice/usbdevice_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ func (h *DevHandler) getList(localUSBDevices map[int][]*deviceplugins.USBDevice,
238238
ResourceName: resourceName(name),
239239
NodeName: nodeName,
240240
DevicePath: localUSBDevice.DevicePath,
241-
Description: usbid.DescribeWithVendorAndProduct(gousb.ID(localUSBDevice.Vendor), gousb.ID(localUSBDevice.Product)),
241+
Description: usbid.DescribeWithVendorAndProduct(gousb.ID(localUSBDevice.Vendor), gousb.ID(localUSBDevice.Product)), // nolint:gosec
242242
PCIAddress: localUSBDevice.PCIAddress,
243243
},
244244
}
@@ -252,7 +252,7 @@ func (h *DevHandler) getList(localUSBDevices map[int][]*deviceplugins.USBDevice,
252252
ResourceName: resourceName(usbDeviceName(nodeName, localUSBDevice)),
253253
NodeName: nodeName,
254254
DevicePath: localUSBDevice.DevicePath,
255-
Description: usbid.DescribeWithVendorAndProduct(gousb.ID(localUSBDevice.Vendor), gousb.ID(localUSBDevice.Product)),
255+
Description: usbid.DescribeWithVendorAndProduct(gousb.ID(localUSBDevice.Vendor), gousb.ID(localUSBDevice.Product)), // nolint:gosec
256256
PCIAddress: localUSBDevice.PCIAddress,
257257
}
258258
updateList = append(updateList, existedCp)

pkg/util/gousb/usbid/describe_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func TestDescribeWithVendorAndProduct(t *testing.T) {
2424
vendor, _ := strconv.ParseInt(tc.vendor, 16, 64)
2525
product, _ := strconv.ParseInt(tc.product, 16, 64)
2626

27-
output := DescribeWithVendorAndProduct(gousb.ID(vendor), gousb.ID(product))
27+
output := DescribeWithVendorAndProduct(gousb.ID(vendor), gousb.ID(product)) // nolint:gosec
2828

2929
assert.Equal(t, tc.expected, output)
3030
}

pkg/util/gousb/usbid/parse.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func (p *Parser) split(s string) (kind string, level int, id uint64, name string
130130
}
131131

132132
func (p *Parser) parseVendor(level int, raw uint64, name string) error {
133-
id := gousb.ID(raw)
133+
id := gousb.ID(raw) // nolint:gosec
134134

135135
switch level {
136136
case 0:
@@ -175,7 +175,7 @@ func (p *Parser) parseClass(level int, id uint64, name string) error {
175175
p.class = &Class{
176176
Name: name,
177177
}
178-
p.classes[gousb.Class(id)] = p.class
178+
p.classes[gousb.Class(id)] = p.class // nolint:gosec
179179

180180
case 1:
181181
if p.class == nil {
@@ -188,7 +188,7 @@ func (p *Parser) parseClass(level int, id uint64, name string) error {
188188
if p.class.SubClass == nil {
189189
p.class.SubClass = make(map[gousb.Class]*SubClass)
190190
}
191-
p.class.SubClass[gousb.Class(id)] = p.subclass
191+
p.class.SubClass[gousb.Class(id)] = p.subclass // nolint:gosec
192192

193193
case 2:
194194
if p.subclass == nil {
@@ -198,7 +198,7 @@ func (p *Parser) parseClass(level int, id uint64, name string) error {
198198
if p.subclass.Protocol == nil {
199199
p.subclass.Protocol = make(map[gousb.Protocol]string)
200200
}
201-
p.subclass.Protocol[gousb.Protocol(id)] = name
201+
p.subclass.Protocol[gousb.Protocol(id)] = name // nolint:gosec
202202

203203
default:
204204
return fmt.Errorf("too many levels of nesting for class")

0 commit comments

Comments
 (0)