Skip to content

Commit af29ce4

Browse files
authored
Merge pull request #425 from andyzhangx/fix-golint-error
test: fix golint error
2 parents 7e59f2a + 451abde commit af29ce4

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

.github/workflows/static.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ jobs:
77
name: Go Lint
88
runs-on: ubuntu-latest
99
steps:
10-
- name: Checkout code
11-
uses: actions/checkout@master
10+
- name: Set up Go 1.x
11+
uses: actions/setup-go@v3
12+
with:
13+
go-version: ^1.19
14+
- uses: actions/checkout@master
1215
- name: Run linter
13-
uses: golangci/golangci-lint-action@v2
16+
uses: golangci/golangci-lint-action@v3
1417
with:
15-
version: v1.45
18+
version: v1.51
1619
args: -E=gofmt,deadcode,unused,varcheck,ineffassign,revive,misspell,exportloopref,asciicheck,bodyclose,contextcheck --timeout=30m0s
1720
verify-helm:
1821
name: Verify Helm

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/kubernetes-csi/csi-driver-nfs
22

3-
go 1.18
3+
go 1.19
44

55
require (
66
github.com/container-storage-interface/spec v1.5.0

pkg/nfs/nfs_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717
package nfs
1818

1919
import (
20-
"io/ioutil"
2120
"os"
2221
"path/filepath"
2322
"testing"
@@ -65,7 +64,7 @@ func TestNewFakeDriver(t *testing.T) {
6564
}
6665

6766
func TestIsCorruptedDir(t *testing.T) {
68-
existingMountPath, err := ioutil.TempDir(os.TempDir(), "csi-mount-test")
67+
existingMountPath, err := os.MkdirTemp(os.TempDir(), "csi-mount-test")
6968
if err != nil {
7069
t.Fatalf("failed to create tmp dir: %v", err)
7170
}

release-tools/filter-junit.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ package main
2424
import (
2525
"encoding/xml"
2626
"flag"
27-
"io/ioutil"
2827
"os"
2928
"regexp"
3029
)
@@ -96,7 +95,7 @@ func main() {
9695
}
9796
} else {
9897
var err error
99-
data, err = ioutil.ReadFile(input)
98+
data, err = os.ReadFile(input)
10099
if err != nil {
101100
panic(err)
102101
}
@@ -143,7 +142,7 @@ func main() {
143142
panic(err)
144143
}
145144
} else {
146-
if err := ioutil.WriteFile(*output, data, 0644); err != nil {
145+
if err := os.WriteFile(*output, data, 0644); err != nil {
147146
panic(err)
148147
}
149148
}

0 commit comments

Comments
 (0)