From 89f3d7b02c584561e5f567c72eaed35c27ab32d9 Mon Sep 17 00:00:00 2001 From: Ivan Sim <1330522+ihcsim@users.noreply.github.com> Date: Wed, 10 Aug 2022 11:46:52 -0700 Subject: [PATCH] Upgrade golangci-lint to latest version (#123) Signed-off-by: Ivan Sim --- .github/workflows/golangci-lint.yml | 4 ++-- pkg/fio/fio.go | 4 ++-- pkg/fio/fio_test.go | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index c2b7157..e814433 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -14,11 +14,11 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: ^1.17 + go-version: 1.17 - uses: actions/checkout@v2 - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. - version: v1.46 + version: v1.48 args: --timeout=5m --modules-download-mode=mod diff --git a/pkg/fio/fio.go b/pkg/fio/fio.go index 2cecdd0..080f8a3 100644 --- a/pkg/fio/fio.go +++ b/pkg/fio/fio.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" + "os" "path/filepath" "time" @@ -189,7 +189,7 @@ func (s *fioStepper) loadConfigMap(ctx context.Context, args *RunFIOArgs) (*v1.C } switch { case args.FIOJobFilepath != "": - data, err := ioutil.ReadFile(args.FIOJobFilepath) + data, err := os.ReadFile(args.FIOJobFilepath) if err != nil { return nil, errors.Wrap(err, "File reading error") } diff --git a/pkg/fio/fio_test.go b/pkg/fio/fio_test.go index f53d1f3..d9daf2c 100644 --- a/pkg/fio/fio_test.go +++ b/pkg/fio/fio_test.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" "os" "testing" @@ -382,7 +381,7 @@ func (s *FIOTestSuite) TestValidateNamespace(c *C) { func (s *FIOTestSuite) TestLoadConfigMap(c *C) { ctx := context.Background() - file, err := ioutil.TempFile("", "tempTLCfile") + file, err := os.CreateTemp("", "tempTLCfile") c.Check(err, IsNil) defer os.Remove(file.Name()) for i, tc := range []struct {