Skip to content

Commit fc60cd6

Browse files
committed
chore: update & lint
* updated require go version to 1.19 * updated dependencies * updated linting rules * updated github actions * updated README links & badges * relinted tests, refacored tests using testify Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
1 parent 1f158e5 commit fc60cd6

File tree

6 files changed

+251
-347
lines changed

6 files changed

+251
-347
lines changed

.github/workflows/go-test.yml

+24-13
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,50 @@
1-
name: Go Test
1+
name: go test
22

33
on: [push, pull_request]
44

55
jobs:
6-
76
lint:
8-
name: lint
7+
name: Lint
98
runs-on: ubuntu-latest
109
steps:
1110
- uses: actions/checkout@v3
12-
- uses: actions/setup-go@v3
11+
- uses: actions/setup-go@v4
1312
with:
14-
go-version: "^1"
13+
go-version: stable
1514
check-latest: true
1615
cache: true
1716
- name: golangci-lint
1817
uses: golangci/golangci-lint-action@v3
1918
with:
20-
version: v1.50
19+
version: latest
2120
only-new-issues: true
2221

2322
test:
24-
needs: [lint]
25-
name: Test
23+
name: Unit tests
2624
runs-on: ${{ matrix.os }}
2725

2826
strategy:
2927
matrix:
3028
os: [ ubuntu-latest, macos-latest, windows-latest ]
31-
steps:
29+
go_version: ['oldstable', 'stable' ]
3230

33-
- uses: actions/setup-go@v2
31+
steps:
32+
- name: Run unit tests
33+
uses: actions/setup-go@v4
3434
with:
35-
go-version: 1.x
35+
go-version: '${{ matrix.go_version }}'
36+
check-latest: true
37+
cache: true
3638

37-
- uses: actions/checkout@v2
39+
- uses: actions/checkout@v3
3840

39-
- run: go test
41+
- run: go test -v -race -coverprofile="coverage-${{ matrix.os }}.${{ matrix.go_version }}.out" -covermode=atomic ./...
42+
43+
- name: Upload coverage to codecov
44+
uses: codecov/codecov-action@v3
45+
with:
46+
files: './coverage-${{ matrix.os }}.${{ matrix.go_version }}.out'
47+
flags: '${{ matrix.go_version }}'
48+
os: '${{ matrix.os }}'
49+
fail_ci_if_error: false
50+
verbose: true

.golangci.yml

+34-23
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,61 @@
11
linters-settings:
22
govet:
33
check-shadowing: true
4+
golint:
5+
min-confidence: 0
46
gocyclo:
5-
min-complexity: 30
7+
min-complexity: 45
68
maligned:
79
suggest-new: true
810
dupl:
9-
threshold: 100
11+
threshold: 200
1012
goconst:
1113
min-len: 2
12-
min-occurrences: 4
13-
paralleltest:
14-
ignore-missing: true
14+
min-occurrences: 3
15+
1516
linters:
1617
enable-all: true
1718
disable:
1819
- maligned
20+
- unparam
1921
- lll
22+
- gochecknoinits
2023
- gochecknoglobals
24+
- funlen
2125
- godox
2226
- gocognit
2327
- whitespace
2428
- wsl
25-
- funlen
26-
- gochecknoglobals
27-
- gochecknoinits
28-
- scopelint
2929
- wrapcheck
30-
- exhaustivestruct
31-
- exhaustive
32-
- nlreturn
3330
- testpackage
34-
- gci
35-
- gofumpt
36-
- goerr113
31+
- nlreturn
3732
- gomnd
38-
- tparallel
33+
- exhaustivestruct
34+
- goerr113
35+
- errorlint
3936
- nestif
4037
- godot
41-
- errorlint
42-
- varcheck
43-
- interfacer
44-
- deadcode
45-
- golint
38+
- gofumpt
39+
- paralleltest
40+
- tparallel
41+
- thelper
4642
- ifshort
43+
- exhaustruct
44+
- varnamelen
45+
- gci
46+
- depguard
47+
- errchkjson
48+
- inamedparam
49+
- nonamedreturns
50+
- musttag
51+
- ireturn
52+
- forcetypeassert
53+
- cyclop
54+
# deprecated linters
55+
- deadcode
56+
- interfacer
57+
- scopelint
58+
- varcheck
4759
- structcheck
60+
- golint
4861
- nosnakecase
49-
- varnamelen
50-
- exhaustruct

README.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
# gojsonreference [![Build Status](https://travis-ci.org/go-openapi/jsonreference.svg?branch=master)](https://travis-ci.org/go-openapi/jsonreference) [![codecov](https://codecov.io/gh/go-openapi/jsonreference/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/jsonreference) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io)
1+
# gojsonreference [![Build Status](https://github.com/go-openapi/jsonreference/actions/workflows/go-test.yml/badge.svg)](https://github.com/go-openapi/jsonreference/actions?query=workflow%3A"go+test") [![codecov](https://codecov.io/gh/go-openapi/jsonreference/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/jsonreference)
22

3+
[![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io)
34
[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/jsonreference/master/LICENSE) [![GoDoc](https://godoc.org/github.com/go-openapi/jsonreference?status.svg)](http://godoc.org/github.com/go-openapi/jsonreference)
5+
[![Go Reference](https://pkg.go.dev/badge/github.com/go-openapi/jsonreference.svg)](https://pkg.go.dev/github.com/go-openapi/jsonreference)
6+
[![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/jsonreference)](https://goreportcard.com/report/github.com/go-openapi/jsonreference)
7+
48
An implementation of JSON Reference - Go language
59

610
## Status
711
Feature complete. Stable API
812

913
## Dependencies
10-
https://github.com/go-openapi/jsonpointer
14+
* https://github.com/go-openapi/jsonpointer
1115

1216
## References
13-
http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-07
1417

15-
http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03
18+
* http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-07
19+
* http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03

go.mod

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
module github.com/go-openapi/jsonreference
22

33
require (
4-
github.com/go-openapi/jsonpointer v0.19.6
5-
github.com/stretchr/testify v1.8.1
4+
github.com/go-openapi/jsonpointer v0.20.0
5+
github.com/stretchr/testify v1.8.4
66
)
77

8-
go 1.13
8+
require (
9+
github.com/davecgh/go-spew v1.1.1 // indirect
10+
github.com/go-openapi/swag v0.22.4 // indirect
11+
github.com/josharian/intern v1.0.0 // indirect
12+
github.com/mailru/easyjson v0.7.7 // indirect
13+
github.com/pmezard/go-difflib v1.0.0 // indirect
14+
github.com/rogpeppe/go-internal v1.11.0 // indirect
15+
gopkg.in/yaml.v3 v3.0.1 // indirect
16+
)
17+
18+
go 1.19

go.sum

+9-20
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,22 @@
1-
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
2-
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
31
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
42
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
5-
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
6-
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
7-
github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
8-
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
3+
github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ=
4+
github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA=
5+
github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU=
6+
github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
97
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
108
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
11-
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
12-
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
13-
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
14-
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
9+
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
1510
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
16-
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
1711
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
1812
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
1913
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
2014
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
21-
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
22-
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
23-
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
24-
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
25-
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
26-
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
27-
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
15+
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
16+
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
17+
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
18+
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
2819
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
2920
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
30-
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
31-
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
3221
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
3322
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 commit comments

Comments
 (0)