diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 59a4fec..4a07339 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version-file: 'go.mod' # This step sets up the variable steps.golangci-lint-version.outputs.v @@ -22,7 +22,6 @@ jobs: GOLANGCI_LINT_VERSION=$( go list -m -f '{{.Version}}' github.com/golangci/golangci-lint ) echo "v=$GOLANGCI_LINT_VERSION" >> "$GITHUB_OUTPUT" - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 with: version: ${{ steps.golangci-lint-version.outputs.v }} - skip-pkg-cache: true \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a34c8e8..85d71e2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version-file: 'go.mod' diff --git a/.github/workflows/build.yml b/.github/workflows/test.yml similarity index 90% rename from .github/workflows/build.yml rename to .github/workflows/test.yml index c9cd5a5..ac46a7c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: build +name: test on: push: @@ -6,13 +6,13 @@ on: pull_request: jobs: - build: + test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version-file: 'go.mod' diff --git a/.golangci.yml b/.golangci.yml index 1cb1704..b97a8fe 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,3 @@ -run: - go: '1.18' - linters-settings: gofmt: simplify: false diff --git a/zendesk/cursor.go b/zendesk/cursor.go index 9c0ae34..d6bfe47 100644 --- a/zendesk/cursor.go +++ b/zendesk/cursor.go @@ -19,7 +19,7 @@ import ( "encoding/base64" "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "strconv" "time" @@ -97,7 +97,7 @@ func (c *Cursor) FetchRecords(ctx context.Context) ([]sdk.Record, error) { return nil, fmt.Errorf("non 200 status code received(%v)", resp.StatusCode) } - ticketList, err := ioutil.ReadAll(resp.Body) + ticketList, err := io.ReadAll(resp.Body) if err != nil { return nil, fmt.Errorf("error reading the response body: %w", err) } diff --git a/zendesk/cursor_test.go b/zendesk/cursor_test.go index d34eca6..711651a 100644 --- a/zendesk/cursor_test.go +++ b/zendesk/cursor_test.go @@ -18,7 +18,7 @@ import ( "context" "encoding/base64" "fmt" - "io/ioutil" + "io" "net/http" "net/http/httptest" "net/url" @@ -138,7 +138,7 @@ func (t *testHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { assert.Equal(t.t, t.url.Path, r.URL.Path) assert.Equal(t.t, t.url.RawQuery, r.URL.RawQuery) - bodyBytes, err := ioutil.ReadAll(r.Body) + bodyBytes, err := io.ReadAll(r.Body) assert.NoError(t.t, err) if len(t.wantBody) > 0 { diff --git a/zendesk/importer.go b/zendesk/importer.go index e8d9cac..9f6ddb4 100644 --- a/zendesk/importer.go +++ b/zendesk/importer.go @@ -19,7 +19,7 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "strconv" "time" @@ -109,7 +109,7 @@ func (b *BulkImporter) Write(ctx context.Context, records []sdk.Record) error { if resp.StatusCode != http.StatusOK { // no use checking the error, if it errors, we will just have empty body message in error - bodyBytes, _ := ioutil.ReadAll(resp.Body) + bodyBytes, _ := io.ReadAll(resp.Body) return fmt.Errorf("non 200 status code(%d) received(%v)", resp.StatusCode, string(bodyBytes)) }