File tree Expand file tree Collapse file tree 6 files changed +13
-19
lines changed Expand file tree Collapse file tree 6 files changed +13
-19
lines changed Original file line number Diff line number Diff line change @@ -12,12 +12,11 @@ jobs:
1212 strategy :
1313 fail-fast : true
1414 matrix :
15- go : ['1.14', '1.x']
16- # Locked at https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
15+ go : ['1.16', '1.x']
1716 os :
18- - ubuntu-20.04
19- - windows-2019
20- - macos-10.15
17+ - ubuntu-latest
18+ - windows-latest
19+ - macos-latest
2120 runs-on : ${{ matrix.os }}
2221 defaults :
2322 run :
4746 with :
4847 path : ${{ steps.go-cache-paths.outputs.go-mod }}
4948 key : ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }}
50- if : matrix.go != '1.14'
51-
5249
5350 - uses : actions/checkout@v2
5451
7067 CGO_ENABLED : ' 1'
7168 - if : runner.os == 'Linux'
7269 run : git --no-pager diff && [[ $(git --no-pager diff --name-only | wc -l) = 0 ]]
73- - run : |
74- cp openapi3/testdata/load_with_go_embed_test.go openapi3/
75- cat go.mod | sed 's%go 1.14%go 1.16%' >gomod && mv gomod go.mod
76- go test ./...
77- if: matrix.go != '1.14'
78-
7970
8071 - if : runner.os == 'Linux'
8172 name : Errors must not be capitalized https://github.com/golang/go/wiki/CodeReviewComments#error-strings
Original file line number Diff line number Diff line change 1818
1919 # IntelliJ / GoLand
2020.idea
21-
22- /openapi3 /load_with_go_embed_test.go
23- .vscode
21+ .vscode
Original file line number Diff line number Diff line change 11module github.com/getkin/kin-openapi
22
3- go 1.14
3+ go 1.16
44
55require (
66 github.com/ghodss/yaml v1.0.0
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package openapi3
22
33import (
44 "context"
5+ "errors"
56 "fmt"
67 "net/url"
78
@@ -26,7 +27,7 @@ func (e *ExternalDocs) UnmarshalJSON(data []byte) error {
2627
2728func (e * ExternalDocs ) Validate (ctx context.Context ) error {
2829 if e .URL == "" {
29- return fmt . Errorf ("url is required" )
30+ return errors . New ("url is required" )
3031 }
3132 if _ , err := url .Parse (e .URL ); err != nil {
3233 return fmt .Errorf ("url is incorrect: %w" , err )
Original file line number Diff line number Diff line change 1+ //go:build go1.16
2+ // +build go1.16
3+
14package openapi3_test
25
36import (
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package openapi3
22
33import (
44 "context"
5+ "errors"
56 "fmt"
67
78 "github.com/getkin/kin-openapi/jsoninfo"
@@ -99,7 +100,7 @@ func (requestBody *RequestBody) UnmarshalJSON(data []byte) error {
99100
100101func (value * RequestBody ) Validate (ctx context.Context ) error {
101102 if value .Content == nil {
102- return fmt . Errorf ("content of the request body is required" )
103+ return errors . New ("content of the request body is required" )
103104 }
104105 return value .Content .Validate (ctx )
105106}
You can’t perform that action at this time.
0 commit comments