Skip to content

Commit

Permalink
Update go version and golangci-lint version
Browse files Browse the repository at this point in the history
  • Loading branch information
osamingo committed Feb 18, 2021
1 parent 9a859af commit 206f0bb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 41 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.36.0
version: v1.37.0
test:
name: Test
runs-on: ubuntu-18.04
strategy:
matrix:
go: [ '1.14.x', '1.15.x' ]
go: [ '1.15.x', '1.16.x' ]
steps:
- name: Check out code
uses: actions/checkout@v2
Expand All @@ -33,7 +33,7 @@ jobs:
with:
go-version: ${{ matrix.go }}
- name: Test Go Code
run: go test -v -race -covermode=atomic -coverprofile=coverage.txt ./...
run: go test -race -covermode=atomic -coverprofile=coverage.txt ./...
env:
KENALL_AUTHORIZATION_TOKEN: ${{ secrets.KENALL_AUTHORIZATION_TOKEN }}
- name: Upload coverage to Codecov
Expand Down
11 changes: 6 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ linters-settings:

linters:
enable-all: true
disable:
- wsl

issues:
exclude-rules:
- path: _test\.go
text: "does not use range value in test Run"
linters:
- lll
- funlen
- paralleltest
- forbidigo
- path: _test\.go
linters:
- lll
- goerr113
- exhaustivestruct
- cyclop
37 changes: 4 additions & 33 deletions kenall_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func TestNewClient(t *testing.T) {

for name, c := range cases {
c := c

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -90,6 +91,7 @@ func TestClient_GetAddress(t *testing.T) {

for name, c := range cases {
c := c

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -126,6 +128,7 @@ func TestVersion_UnmarshalJSON(t *testing.T) {

for name, c := range cases {
c := c

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -163,39 +166,7 @@ func ExampleClient_GetAddress() {
func runTestingServer(t *testing.T) *httptest.Server {
t.Helper()

const data = `{
"version": "2020-11-30",
"data": [
{
"jisx0402": "13101",
"old_code": "100",
"postal_code": "1008105",
"prefecture_kana": "",
"city_kana": "",
"town_kana": "",
"town_kana_raw": "",
"prefecture": "東京都",
"city": "千代田区",
"town": "大手町",
"koaza": "",
"kyoto_street": "",
"building": "",
"floor": "",
"town_partial": false,
"town_addressed_koaza": false,
"town_chome": false,
"town_multi": false,
"town_raw": "大手町",
"corporation": {
"name": "チッソ 株式会社",
"name_kana": "チツソ カブシキガイシヤ",
"block_lot": "2丁目2-1(新大手町ビル)",
"post_office": "銀座",
"code_type": 0
}
}
]
}`
const data = `{"version":"2020-11-30","data":[{"jisx0402":"13101","old_code":"100","postal_code":"1008105","prefecture_kana":"","city_kana":"","town_kana":"","town_kana_raw":"","prefecture":"東京都","city":"千代田区","town":"大手町","koaza":"","kyoto_street":"","building":"","floor":"","town_partial":false,"town_addressed_koaza":false,"town_chome":false,"town_multi":false,"town_raw":"大手町","corporation":{"name":"チッソ 株式会社","name_kana":"チツソ カブシキガイシヤ","block_lot":"2丁目2-1(新大手町ビル)","post_office":"銀座","code_type":0}}]}`

return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
token := strings.Fields(r.Header.Get("Authorization"))
Expand Down

0 comments on commit 206f0bb

Please sign in to comment.