diff --git a/.golangci.yml b/.golangci.yml index ba65561b..abe39374 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,5 @@ run: - deadline: 10m + timeout: 10m linters: enable: diff --git a/Makefile b/Makefile index a1d089ec..32da46f4 100644 --- a/Makefile +++ b/Makefile @@ -63,18 +63,9 @@ assert-fmt: rm fmt.out; \ fi -ineffassign: - ineffassign $(MODULE)/... - lint: # We use `go list -f '{{.Dir}}' $(MODULE)/...` to skip the `vendor` folder. - go list -f '{{.Dir}}' $(MODULE)/... | xargs golint -set_exit_status - -misspell: - misspell $(MODULE)/... - -vet: - go vet $(MODULE)/... + golangci-lint run ./... COVERAGE_FILE := coverage.out test: build diff --git a/cmd/nvidia-vgpu-dm/main.go b/cmd/nvidia-vgpu-dm/main.go index 1619a579..67edbf89 100644 --- a/cmd/nvidia-vgpu-dm/main.go +++ b/cmd/nvidia-vgpu-dm/main.go @@ -69,6 +69,6 @@ func main() { err := c.Run(os.Args) if err != nil { - log.Fatalf(err.Error()) + log.Fatal(err.Error()) } } diff --git a/pkg/types/device.go b/pkg/types/device.go index 53ca644b..5227572c 100644 --- a/pkg/types/device.go +++ b/pkg/types/device.go @@ -31,7 +31,7 @@ func NewDeviceID(device, vendor uint16) DeviceID { // NewDeviceIDFromString constructs a 'DeviceID' from its string representation. func NewDeviceIDFromString(str string) (DeviceID, error) { - deviceID, err := strconv.ParseInt(str, 0, 32) + deviceID, err := strconv.ParseUint(str, 0, 32) if err != nil { return 0, fmt.Errorf("unable to create DeviceID from string '%v': %v", str, err) } @@ -45,10 +45,12 @@ func (d DeviceID) String() string { // GetVendor returns the 'vendor' portion of a 'DeviceID'. func (d DeviceID) GetVendor() uint16 { + // nolint:gosec // DeviceID is constructed from two uint16 numbers return uint16(d) } // GetDevice returns the 'device' portion of a 'DeviceID'. func (d DeviceID) GetDevice() uint16 { + // nolint:gosec // DeviceID is constructed from two uint16 numbers return uint16(d >> 16) } diff --git a/versions.mk b/versions.mk index f9071b6b..485bf34e 100644 --- a/versions.mk +++ b/versions.mk @@ -16,6 +16,6 @@ VERSION ?= v0.2.7 vVERSION := v$(VERSION:v%=%) -GOLANG_VERSION ?= 1.22.5 +GOLANG_VERSION ?= 1.22.8 GIT_COMMIT ?= $(shell git describe --match="" --dirty --long --always --abbrev=40 2> /dev/null || echo "")