Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#### Description

#### Checklist

- [ ] I have resolved all the comments, either here or in real life
- [ ] I have added automated tests that cover the new behaviour and removed obsolete tests and code
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
44 changes: 44 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI

on:
push:
branches: ["main", "master"]
pull_request:
branches: ["main", "master"]

env:
GO111MODULE: on
GO_VERSION: "1.19"
LINTER_VERSION: "1.50.1"

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}.x
- name: Checkout code
uses: actions/checkout@v2
- name: Run linters
uses: golangci/golangci-lint-action@v2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: they always use the latest patch version.
version: v${{ env.LINTER_VERSION }}
# enable gofmt to check formatting issues
args: --enable gofmt
# show only new issues if it's a pull request. The default value is `false`.
only-new-issues: true

test:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}.x
- name: Checkout code
uses: actions/checkout@v2
- name: Run tests
run: go test -count=1 ./...
10 changes: 5 additions & 5 deletions bulk/bulk_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package bulk

import (
"io/ioutil"
"io"
"net/http"
"reflect"
"strings"
Expand Down Expand Up @@ -74,7 +74,7 @@ func TestResource_CreateJob(t *testing.T) {
return &http.Response{
StatusCode: 500,
Status: "Invalid URL",
Body: ioutil.NopCloser(strings.NewReader(req.URL.String())),
Body: io.NopCloser(strings.NewReader(req.URL.String())),
Header: make(http.Header),
}
}
Expand All @@ -99,7 +99,7 @@ func TestResource_CreateJob(t *testing.T) {
return &http.Response{
StatusCode: http.StatusOK,
Status: "Good",
Body: ioutil.NopCloser(strings.NewReader(resp)),
Body: io.NopCloser(strings.NewReader(resp)),
Header: make(http.Header),
}

Expand Down Expand Up @@ -141,7 +141,7 @@ func TestResource_AllJobs(t *testing.T) {
return &http.Response{
StatusCode: 500,
Status: "Invalid URL",
Body: ioutil.NopCloser(strings.NewReader(req.URL.String())),
Body: io.NopCloser(strings.NewReader(req.URL.String())),
Header: make(http.Header),
}
}
Expand Down Expand Up @@ -171,7 +171,7 @@ func TestResource_AllJobs(t *testing.T) {
return &http.Response{
StatusCode: http.StatusOK,
Status: "Good",
Body: ioutil.NopCloser(strings.NewReader(resp)),
Body: io.NopCloser(strings.NewReader(resp)),
Header: make(http.Header),
}
}),
Expand Down
2 changes: 1 addition & 1 deletion bulk/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ func (j *Job) UnprocessedRecords() ([]UnprocessedRecord, error) {
}

func (j *Job) recordResultHeader(scanner *bufio.Scanner, delimiter string) ([]string, error) {
if scanner.Scan() == false {
if !scanner.Scan() {
return nil, errors.New("job: response needs to have header")
}
text := strings.Replace(scanner.Text(), "\"", "", -1)
Expand Down
Loading