Skip to content

Commit 1fa903b

Browse files
authored
Merge pull request #46 from kenzo0107/go_version_up_to_1_19_1
Go バージョンアップ 1.19.1
2 parents e503af2 + 4a57fc1 commit 1fa903b

File tree

14 files changed

+45
-48
lines changed

14 files changed

+45
-48
lines changed

.github/workflows/lint.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ jobs:
1313
lint:
1414
strategy:
1515
matrix:
16-
go-version: [1.17.x]
16+
go-version: [1.19.x]
1717
os: [ubuntu-latest]
1818
name: lint
1919
runs-on: ${{ matrix.os }}
2020
steps:
21-
- uses: actions/checkout@v2
22-
- name: golangci-lint
23-
uses: golangci/golangci-lint-action@v2
21+
- uses: actions/checkout@v3
22+
- uses: actions/setup-go@v3
2423
with:
25-
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
26-
version: v1.29
24+
go-version: ${{ matrix.go-version }}
25+
- run: make lint

.github/workflows/test.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,17 @@ jobs:
1313
test:
1414
strategy:
1515
matrix:
16-
go-version: [1.17.x]
16+
go-version: [1.19.x]
1717
platform: [ubuntu-latest]
1818
runs-on: ${{ matrix.platform }}
1919
steps:
20-
- name: Install Go
21-
uses: actions/setup-go@v1
20+
- uses: actions/setup-go@v3
2221
with:
2322
go-version: ${{ matrix.go-version }}
24-
- name: Checkout code
25-
uses: actions/checkout@v1
26-
- name: Test
27-
run: go test -v -count=1 -race -cover -coverprofile=coverage ./...
23+
- uses: actions/checkout@v3
24+
- run: go test -v -count=1 -race -cover -coverprofile=coverage ./...
2825
- name: Upload coverage to Codecov
29-
uses: codecov/codecov-action@v1
26+
uses: codecov/codecov-action@v3
3027
with:
3128
token: ${{ secrets.CODECOV_TOKEN }}
3229
file: ./coverage

.go-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

.golangci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
linters:
22
enable:
33
- goimports
4-
- golint
4+
- revive
55
- gosec
66

77
linters-settings:
88
errcheck:
99
# report about not checking of errors in type assertions: `a := b.(MyStruct)`;
1010
# default is false: such cases aren't reported by default.
1111
check-type-assertions: true
12-
golint:
13-
# minimal confidence for issues, default is 0.8
14-
# 小さいほど厳しくチェックする
15-
min-confidence: 0.3
1612
govet:
1713
# report about shadowed variables
1814
check-shadowing: true
@@ -24,4 +20,8 @@ issues:
2420
- staticcheck
2521
# NOTE: TestMain での os.Exit 呼び出しは Go 1.15 で不要
2622
# see: https://golang.org/doc/go1.15#testing
27-
text: "SA3000:"
23+
text: 'SA3000:'
24+
- linters:
25+
- revive
26+
# NOTE: パッケージコメントを適宜追加するのは開発効率が悪くなるという判断よりコメントは不要
27+
text: 'package-comments: should have a package comment'

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
golang 1.19.1

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ cov:
3434

3535
## Install linter tool
3636
install_linter:
37-
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.43.0
37+
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.49.0
3838
.PHONY: install_linter
3939

4040
## Lint

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/kenzo0107/backlog
22

3-
go 1.17
3+
go 1.19
44

55
require (
66
github.com/google/go-querystring v1.1.0

go.sum

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
22
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
3+
github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM=
34
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
4-
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
5-
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
65
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
76
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
87
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=

issue.go

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -199,19 +199,21 @@ type Issues []*struct {
199199
// GetUserMySelfRecentrlyViewedIssues returns the list of issues a user view recently
200200
// This api returns a json below:
201201
// [
202-
// {
203-
// "issue":{
204-
// "id":1111111,
205-
// ...
206-
// }
207-
// },
208-
// {
209-
// "issue":{
210-
// "id":2222222,
211-
// ...
212-
// }
213-
// }
214-
// ...
202+
//
203+
// {
204+
// "issue":{
205+
// "id":1111111,
206+
// ...
207+
// }
208+
// },
209+
// {
210+
// "issue":{
211+
// "id":2222222,
212+
// ...
213+
// }
214+
// }
215+
// ...
216+
//
215217
// ]
216218
func (c *Client) GetUserMySelfRecentrlyViewedIssues(opts *GetUserMySelfRecentrlyViewedIssuesOptions) (Issues, error) {
217219
return c.GetUserMySelfRecentrlyViewedIssuesContext(context.Background(), opts)

issue_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"github.com/kylelemons/godebug/pretty"
1414
)
1515

16-
var testJSONSharedFile string = fmt.Sprintf(`{
16+
var testJSONSharedFile = fmt.Sprintf(`{
1717
"id": 454403,
1818
"type": "file",
1919
"dir": "/ユーザアイコン/",
@@ -25,7 +25,7 @@ var testJSONSharedFile string = fmt.Sprintf(`{
2525
"updated": "2006-01-02T15:04:05Z"
2626
}`, testJSONUser, testJSONUser)
2727

28-
var testJSONIssue string = fmt.Sprintf(`{
28+
var testJSONIssue = fmt.Sprintf(`{
2929
"id": 1,
3030
"projectId": 1,
3131
"issueKey": "BLG-1",
@@ -105,15 +105,15 @@ var testJSONIssue string = fmt.Sprintf(`{
105105
]
106106
}`, testJSONUser, testJSONUser, testJSONUser, testJSONSharedFile, testJSONUser)
107107

108-
var testJSONNotification string = fmt.Sprintf(`{
108+
var testJSONNotification = fmt.Sprintf(`{
109109
"id":22,
110110
"alreadyRead":false,
111111
"reason":2,
112112
"user": %s,
113113
"resourceAlreadyRead":false
114114
}`, testJSONUser)
115115

116-
var testJSONIssueComment string = fmt.Sprintf(`{
116+
var testJSONIssueComment = fmt.Sprintf(`{
117117
"id": 6586,
118118
"content": "テスト",
119119
"changeLog": null,
@@ -124,7 +124,7 @@ var testJSONIssueComment string = fmt.Sprintf(`{
124124
"notifications": [%s]
125125
}`, testJSONUser, testJSONNotification)
126126

127-
var testJSONAttachment string = fmt.Sprintf(`{
127+
var testJSONAttachment = fmt.Sprintf(`{
128128
"id": 1,
129129
"name": "Duke.png",
130130
"size": 196186,

space_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package backlog
33
import (
44
"bytes"
55
"fmt"
6-
"io/ioutil"
6+
"io"
77
"log"
88
"net/http"
99
"reflect"
@@ -108,7 +108,7 @@ func TestGetSpaceFailed(t *testing.T) {
108108
type mockHTTPClient struct{}
109109

110110
func (m *mockHTTPClient) Do(*http.Request) (*http.Response, error) {
111-
return &http.Response{StatusCode: 200, Body: ioutil.NopCloser(bytes.NewBufferString(`OK`))}, nil
111+
return &http.Response{StatusCode: 200, Body: io.NopCloser(bytes.NewBufferString(`OK`))}, nil
112112
}
113113

114114
func TestGetSpaceIcon(t *testing.T) {

time_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"time"
66
)
77

8-
var referenceTime time.Time = time.Date(2006, time.January, 02, 15, 04, 05, 0, time.UTC)
8+
var referenceTime = time.Date(2006, time.January, 02, 15, 04, 05, 0, time.UTC)
99

1010
func TestTimestamp_String(t *testing.T) {
1111
tests := []struct {

watching_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/pkg/errors"
1212
)
1313

14-
var testJSONUserWatching string = fmt.Sprintf(`{
14+
var testJSONUserWatching = fmt.Sprintf(`{
1515
"id": 1,
1616
"resourceAlreadyRead": true,
1717
"note": "This is a note for the watching issue.",

wiki_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const testJSONWiki string = `{
5757
"updated": "2006-01-02T15:04:05Z"
5858
}`
5959

60-
var testJSONRecentlyViewedWiki string = fmt.Sprintf(`{
60+
var testJSONRecentlyViewedWiki = fmt.Sprintf(`{
6161
"page": %s,
6262
"updated": "2006-01-02T15:04:05Z"
6363
}`, testJSONWiki)

0 commit comments

Comments
 (0)