Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade go and toolset version and run formatter #18

Merged
merged 2 commits into from
Mar 15, 2023
Merged
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: 4 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: lint and test

on: push
on:
push:
pull_request:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because ci job was not started in PR from fork.


jobs:
test:
Expand All @@ -11,7 +13,7 @@ jobs:
- name: setup
uses: actions/setup-go@v2
with:
go-version: "1.14"
go-version: "1.16"
- name: lint
run: make lint
- name: test
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test: ## run go test

# Install golangci-lint
GOLANGCLI_LINT := $(BIN)/golangci-lint
GOLANGCLI_LINT_VERSION := v1.43.0
GOLANGCLI_LINT_VERSION := v1.51.0
$(GOLANGCLI_LINT): | $(BIN) ## Install golangci-lint
@curl -sSfL "https://github.com/raw/golangci/golangci-lint/master/install.sh" | sh -s -- -b $(BIN) $(GOLANGCLI_LINT_VERSION)
@chmod +x "$(BIN)/golangci-lint"
Expand All @@ -44,7 +44,7 @@ lint: | $(GOLANGCLI_LINT) ## run golangci-lint with config .golangcli.yml
# Install gofumpt
# This setting is only available for Mac
GOFMPT := $(BIN)/gofumpt
GOFMPT_VERSION := v0.1.0
GOFMPT_VERSION := v0.4.0
ifeq "$(UNAME_OS)" "Darwin"
GOFMPT_BIN=gofumpt_$(GOFMPT_VERSION)_darwin_amd64
endif
Expand Down
8 changes: 6 additions & 2 deletions crm_imports_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ func addJSONtoMultipart(writer *multipart.Writer, importRequest *CrmImportConfig
if err != nil {
return err
}
part.Write([]byte(data))
if _, err := part.Write(data); err != nil {
return err
}
return nil
}

Expand All @@ -63,7 +65,9 @@ func addFilesToMultipart(writer *multipart.Writer, importRequest *CrmImportConfi
if err != nil {
return err
}
csvPart.Write(fileData)
if _, err := csvPart.Write(fileData); err != nil {
return err
}
}
return nil
}
Expand Down
5 changes: 2 additions & 3 deletions crm_imports_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ func createTestCsv(count int) *bytes.Buffer {
buf := &bytes.Buffer{}
csvwriter := csv.NewWriter(buf)
csvHeader := []string{"email", "firstname", "lastname"}
csvwriter.Write(csvHeader)
_ = csvwriter.Write(csvHeader)

for i := 0; i < count; i++ {
testFirst := fmt.Sprintf("FirstName3%d", i)
testLast := fmt.Sprintf("LastName%d", i)
testEmail := fmt.Sprintf("test%d@example.com", i)
csvwriter.Write([]string{testEmail, testFirst, testLast})
_ = csvwriter.Write([]string{testEmail, testFirst, testLast})
}
csvwriter.Flush()
return buf
Expand Down Expand Up @@ -104,5 +104,4 @@ func TestImportStart(t *testing.T) {
fmt.Printf("%+v\n", res)
fmt.Printf("%+v\n", err)
// t.Error(1)

}
1 change: 0 additions & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ Package hubspot is the root of packages used to access Hubspot APIs.

This library is targeting HubSpot API v3.
Docs are available in https://developers.hubspot.com/docs/api/overview.

*/
package hubspot
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/belong-inc/go-hubspot

go 1.14
go 1.16

require (
github.com/google/go-cmp v0.5.4
Expand Down
1 change: 0 additions & 1 deletion legacy/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ Package legacy is the package for legacy APIs in Hubspot.

Not all APIs of Hubspot have been migrated v3 therefore components for legacy API is put in this package.
Docs are available in https://legacydocs.hubspot.com/docs/overview.

*/
package legacy