Update golang-lint to 1.52.1 and fix newly found errors

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
This commit is contained in:
Hyeongju Johannes Lee 2023-03-20 05:50:59 -07:00
parent db58cd58bc
commit 6c7804b1e0
5 changed files with 9 additions and 5 deletions

View File

@ -58,7 +58,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.50.0
version: v1.52.1
args: -v --timeout 5m
build:

View File

@ -41,6 +41,10 @@ linters:
- wsl
linters-settings:
revive:
rules:
- name: unused-parameter
disabled: true
gofmt:
simplify: true
golint:

2
Jenkinsfile vendored
View File

@ -9,7 +9,7 @@ pipeline {
GO111MODULE="on"
REG="cloud-native-image-registry.westus.cloudapp.azure.com/"
K8S_VERSION="1.25.0"
GOLANGCI_LINT_VERSION="v1.50.0"
GOLANGCI_LINT_VERSION="v1.52.1"
GO_VERSION="1.20"
GO_TAR="go${GO_VERSION}.linux-amd64.tar.gz"
GOROOT="/usr/local/go"

View File

@ -10,7 +10,7 @@ EXTRA_BUILD_ARGS ?= ""
CERT_MANAGER_VERSION ?= v1.11.0
CONTROLLER_GEN_VERSION ?= v0.11.3
GOLANGCI_LINT_VERSION ?= v1.50.1
GOLANGCI_LINT_VERSION ?= v1.52.1
KIND_VERSION ?= v0.17.0
GOLICENSES_VERSION ?= v1.6.0
# Default bundle image tag

View File

@ -62,12 +62,12 @@ func createDevice(pciBusRootDir string, bdf string, vid string, pid string) erro
vidHex := append([]byte(vid), 0xa)
pidHex := append([]byte(pid), 0xa)
err = os.WriteFile(filepath.Join(pciBusRootDir, bdf, "vendor"), vidHex, 0444)
err = os.WriteFile(filepath.Join(pciBusRootDir, bdf, "vendor"), vidHex, 0400)
if err != nil {
return err
}
err = os.WriteFile(filepath.Join(pciBusRootDir, bdf, "device"), pidHex, 0444)
err = os.WriteFile(filepath.Join(pciBusRootDir, bdf, "device"), pidHex, 0400)
if err != nil {
return err
}