From 3d2a6db6ad34734e1548d3a6dc9b1667730d6bf1 Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Sat, 4 Mar 2023 11:53:26 +0000 Subject: [PATCH 1/2] tes: fix golint action failure --- .github/workflows/static.yaml | 14 ++++++++------ go.mod | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/static.yaml b/.github/workflows/static.yaml index 7cafdfe28..3a037513c 100644 --- a/.github/workflows/static.yaml +++ b/.github/workflows/static.yaml @@ -7,11 +7,13 @@ jobs: name: Go Lint runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@master + - name: Set up Go 1.x + uses: actions/setup-go@v3 + with: + go-version: ^1.19 + - uses: actions/checkout@master - name: Run linter - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v3 with: - version: v1.45 - # https://golangci-lint.run/usage/linters/ - args: -E=gofmt,deadcode,unused,varcheck,ineffassign,revive,misspell,exportloopref,asciicheck,bodyclose,depguard,dogsled,dupl,durationcheck,errname,errorlint,forbidigo -D=staticcheck --timeout=30m0s + version: v1.51 + args: -E=gofmt,deadcode,unused,varcheck,ineffassign,revive,misspell,exportloopref,asciicheck,bodyclose,depguard,dogsled,durationcheck,errname,forbidigo -D=staticcheck --timeout=30m0s diff --git a/go.mod b/go.mod index d00cab0c6..04fd7c97e 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module sigs.k8s.io/blob-csi-driver -go 1.18 +go 1.19 require ( github.com/Azure/azure-sdk-for-go v67.3.0+incompatible From 21881bc0bd377a2821841a4d054458e72cd3fb46 Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Sat, 4 Mar 2023 12:12:26 +0000 Subject: [PATCH 2/2] chore: fix golint errors --- pkg/blob/controllerserver.go | 2 +- pkg/blob/nodeserver.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/blob/controllerserver.go b/pkg/blob/controllerserver.go index 983a43e7d..811df35ce 100644 --- a/pkg/blob/controllerserver.go +++ b/pkg/blob/controllerserver.go @@ -182,7 +182,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) if pointer.BoolDeref(enableBlobVersioning, false) { if protocol == NFS || pointer.BoolDeref(isHnsEnabled, false) { - return nil, status.Errorf(codes.InvalidArgument, fmt.Sprintf("enableBlobVersioning is not supported for NFS protocol or HNS enabled account")) + return nil, status.Errorf(codes.InvalidArgument, "enableBlobVersioning is not supported for NFS protocol or HNS enabled account") } } diff --git a/pkg/blob/nodeserver.go b/pkg/blob/nodeserver.go index 8c73f8195..a0e3b8622 100644 --- a/pkg/blob/nodeserver.go +++ b/pkg/blob/nodeserver.go @@ -314,7 +314,7 @@ func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRe }); err != nil { var helpLinkMsg string if d.appendMountErrorHelpLink { - helpLinkMsg = fmt.Sprintf("\nPlease refer to http://aka.ms/blobmounterror for possible causes and solutions for mount errors.") + helpLinkMsg = "\nPlease refer to http://aka.ms/blobmounterror for possible causes and solutions for mount errors." } return nil, status.Error(codes.Internal, fmt.Sprintf("volume(%s) mount %q on %q failed with %v%s", volumeID, source, targetPath, err, helpLinkMsg)) } @@ -373,7 +373,7 @@ func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRe if err != nil { var helpLinkMsg string if d.appendMountErrorHelpLink { - helpLinkMsg = fmt.Sprintf("\nPlease refer to http://aka.ms/blobmounterror for possible causes and solutions for mount errors.") + helpLinkMsg = "\nPlease refer to http://aka.ms/blobmounterror for possible causes and solutions for mount errors." } err = status.Errorf(codes.Internal, "Mount failed with error: %v, output: %v%s", err, output, helpLinkMsg) klog.Errorf("%v", err)