Skip to content

Commit

Permalink
Bump golangci-lint from 1.44.2 to 1.53.3
Browse files Browse the repository at this point in the history
  • Loading branch information
sevein committed Jun 22, 2023
1 parent d54a3d0 commit 87151e0
Show file tree
Hide file tree
Showing 17 changed files with 521 additions and 32 deletions.
6 changes: 3 additions & 3 deletions .bingo/Variables.mk

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .bingo/golangci-lint.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

492 changes: 492 additions & 0 deletions .bingo/golangci-lint.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .bingo/variables.env
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ GO_MOD_UPGRADE="${GOBIN}/go-mod-upgrade-v0.7.0"

GOA="${GOBIN}/goa-v3.11.3"

GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.44.2"
GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.53.3"

GORELEASER="${GOBIN}/goreleaser-v1.4.1"

Expand Down
4 changes: 2 additions & 2 deletions internal/amclient/amclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/http/httptest"
"net/url"
Expand Down Expand Up @@ -140,7 +140,7 @@ func TestNewRequestJSON(t *testing.T) {
t.Fatalf("NewRequest() Content-Type header: %v, want %v", got, want)
}

got, _ := ioutil.ReadAll(req.Body)
got, _ := io.ReadAll(req.Body)
want := []byte(`{"string":"foobar"}
`)
defer req.Body.Close()
Expand Down
4 changes: 2 additions & 2 deletions internal/amclient/bundler/bundler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ package bundler

import (
"bytes"
"io/ioutil"
"os"
"testing"

"github.com/spf13/afero"
)

func TestNewBundlerWithTempDir(t *testing.T) {
transferDir, err := ioutil.TempDir("", "")
transferDir, err := os.MkdirTemp("", "")
if err != nil {
t.Fatal(err)
}
Expand Down
4 changes: 2 additions & 2 deletions internal/amclient/v2_package_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"encoding/base64"
"fmt"
"io/ioutil"
"io"
"net/http"
"testing"

Expand All @@ -23,7 +23,7 @@ func TestPackage_Create(t *testing.T) {
mux.HandleFunc("/api/v2beta/package/", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "POST")

blob, err := ioutil.ReadAll(r.Body)
blob, err := io.ReadAll(r.Body)
if err != nil {
t.Fatal(err)
}
Expand Down
4 changes: 2 additions & 2 deletions internal/batch/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package batch

import (
"context"
"io/ioutil"
"os"
"time"

cadencesdk_workflow "go.uber.org/cadence/workflow"
Expand Down Expand Up @@ -49,7 +49,7 @@ func NewBatchActivity(batchsvc Service) *BatchActivity {
}

func (a *BatchActivity) Execute(ctx context.Context, params BatchWorkflowInput) error {
files, err := ioutil.ReadDir(params.Path)
files, err := os.ReadDir(params.Path)
if err != nil {
return wferrors.NonRetryableError(err)
}
Expand Down
5 changes: 2 additions & 3 deletions internal/filenotify/poller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package filenotify

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"testing"
Expand All @@ -18,7 +17,7 @@ func TestPollerEvent(t *testing.T) {
}
defer w.Close()

tmpdir, err := ioutil.TempDir("", "test-poller")
tmpdir, err := os.MkdirTemp("", "test-poller")
if err != nil {
t.Fatal("error creating temp file")
}
Expand All @@ -37,7 +36,7 @@ func TestPollerEvent(t *testing.T) {
}

path := filepath.Join(tmpdir, "hello.txt")
if err := ioutil.WriteFile(path, []byte("hello"), 0o600); err != nil {
if err := os.WriteFile(path, []byte("hello"), 0o600); err != nil {
t.Fatal(err)
}
if err := assertEvent(w, fsnotify.Create); err != nil {
Expand Down
7 changes: 3 additions & 4 deletions internal/nha/activities/hari.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"encoding/xml"
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
"net/http/httptest"
Expand Down Expand Up @@ -83,7 +82,7 @@ func (a UpdateHARIActivity) Execute(ctx context.Context, params *UpdateHARIActiv
if params.NameInfo.Type == nha.TransferTypeAVLXML {
blob, err = a.slimDown(f)
} else {
blob, err = ioutil.ReadAll(f)
blob, err = io.ReadAll(f)
}
if err != nil {
return wferrors.NonRetryableError(fmt.Errorf("error reading AVLXML file: %v", err))
Expand Down Expand Up @@ -224,7 +223,7 @@ func (a UpdateHARIActivity) sendRequest(ctx context.Context, blob []byte, apiURL
err = fmt.Errorf("unexpected response status: %s", resp.Status)

// Enrich error message with the payload returned when available.
payload, rerr := ioutil.ReadAll(resp.Body)
payload, rerr := io.ReadAll(resp.Body)
if rerr == nil && len(payload) > 0 {
err = fmt.Errorf("(%v) - %s", err, payload)
}
Expand All @@ -237,7 +236,7 @@ func (a UpdateHARIActivity) sendRequest(ctx context.Context, blob []byte, apiURL
// buildMock returns a test server used when HARI's API is not available.
func (a UpdateHARIActivity) buildMock() *httptest.Server {
return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
blob, _ := ioutil.ReadAll(r.Body)
blob, _ := io.ReadAll(r.Body)
defer r.Body.Close()

a.manager.Logger.V(1).Info(
Expand Down
4 changes: 2 additions & 2 deletions internal/nha/activities/hari_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/http/httptest"
"testing"
Expand Down Expand Up @@ -443,7 +443,7 @@ func TestHARIActivity(t *testing.T) {
assert.Equal(t, r.Header.Get("User-Agent"), "Enduro")

if tc.wantReceipt != nil {
blob, err := ioutil.ReadAll(r.Body)
blob, err := io.ReadAll(r.Body)
assert.NilError(t, err)
defer r.Body.Close()

Expand Down
4 changes: 2 additions & 2 deletions internal/nha/activities/identifiers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
)
Expand All @@ -28,7 +28,7 @@ type TransferIdentifierPair struct {
func readIdentifiers(path string) (TransferIdentifiers, error) {
identifiers := TransferIdentifiers([]TransferIdentifier{})

blob, err := ioutil.ReadFile(filepath.Join(path, "metadata", "identifiers.json"))
blob, err := os.ReadFile(filepath.Join(path, "metadata", "identifiers.json"))
if err != nil {
return nil, err
}
Expand Down
3 changes: 1 addition & 2 deletions internal/nha/activities/prod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package activities
import (
"context"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"testing"
Expand All @@ -25,7 +24,7 @@ import (
func TestProdActivity(t *testing.T) {
t.Parallel()

tmpdir, err := ioutil.TempDir("", "")
tmpdir, err := os.MkdirTemp("", "")
assert.NilError(t, err)
defer os.RemoveAll(tmpdir)

Expand Down
3 changes: 1 addition & 2 deletions internal/pipeline/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"errors"
"fmt"
"io/ioutil"
"net"
"net/http"
"net/url"
Expand Down Expand Up @@ -138,7 +137,7 @@ func (p Pipeline) TempFile(pattern string) (*os.File, error) {
if pattern == "" {
pattern = "blob-*"
}
return ioutil.TempFile(p.config.ProcessingDir, pattern)
return os.CreateTemp(p.config.ProcessingDir, pattern)
}

func (p Pipeline) Config() *Config {
Expand Down
5 changes: 2 additions & 3 deletions internal/workflow/activities/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"context"
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -158,7 +157,7 @@ func (a *BundleActivity) SingleFile(ctx context.Context, transferDir, key, tempF
func (a *BundleActivity) Bundle(ctx context.Context, unar archiver.Unarchiver, transferDir, key, tempFile string, stripTopLevelDir bool) (string, string, error) {
// Create a new directory for our transfer with the name randomized.
const prefix = "enduro"
tempDir, err := ioutil.TempDir(transferDir, prefix)
tempDir, err := os.MkdirTemp(transferDir, prefix)
if err != nil {
return "", "", fmt.Errorf("error creating temporary directory: %s", err)
}
Expand All @@ -185,7 +184,7 @@ func (a *BundleActivity) Bundle(ctx context.Context, unar archiver.Unarchiver, t
// Copy a transfer in the given destination using an intermediate temp. directory.
func (a *BundleActivity) Copy(ctx context.Context, src, dst string, stripTopLevelDir bool) (string, string, error) {
const prefix = "enduro"
tempDir, err := ioutil.TempDir(dst, prefix)
tempDir, err := os.MkdirTemp(dst, prefix)
if err != nil {
return "", "", fmt.Errorf("error creating temporary directory: %s", err)
}
Expand Down
1 change: 1 addition & 0 deletions internal/workflow/policies.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func withActivityOptsForLocalAction(ctx cadencesdk_workflow.Context) cadencesdk_

// withActivityOptionsForNoOp returns a workflow context with activity options
// suited for no-op activities.
//
//nolint:deadcode,unused
func withActivityOptsForNoOp(ctx cadencesdk_workflow.Context) cadencesdk_workflow.Context {
return cadencesdk_workflow.WithActivityOptions(ctx, cadencesdk_workflow.ActivityOptions{
Expand Down
3 changes: 2 additions & 1 deletion internal/workflow/processing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,10 @@ func TestTransferInfoProcessingConfiguration(t *testing.T) {
},
}
for _, tc := range testCases {
tc := tc
t.Run("", func(t *testing.T) {
t.Parallel()
tc := tc

result := tc.tinfo.ProcessingConfiguration()
if have, want := result, tc.processingConfig; have != want {
t.Errorf("tinfo.ProcessingConfiguration() returned %s; expected %s", have, want)
Expand Down

0 comments on commit 87151e0

Please sign in to comment.