Skip to content

Commit b16ed90

Browse files
committed
fix ci errors
1 parent 685b4df commit b16ed90

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
strategy:
1010
matrix:
1111
os: [ ubuntu-latest, macos-latest, windows-latest ]
12+
go: [1.18, 1.19]
1213
fail-fast: false
1314

1415
steps:
@@ -17,12 +18,12 @@ jobs:
1718
- name: Set up Go
1819
uses: actions/setup-go@v2
1920
with:
20-
go-version: 1.17.1
21+
go-version: ${{ matrix.go }}
2122

2223
- name: Setup gotestsum
2324
uses: autero1/[email protected]
2425
with:
25-
gotestsum_version: 1.7.0
26+
gotestsum_version: 1.8.1
2627

2728
- name: Test
2829
run: gotestsum --format short-verbose -- -race -timeout=20m -coverprofile=coverage_txt -covermode=atomic ./...

.golangci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,5 @@ linters:
4444
- cyclop
4545
- errname
4646
- varnamelen
47+
- exhaustruct
48+
- maintidx

api.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ func (m MethodNotAllowedError) MarshalJSON() ([]byte, error) {
9999
}
100100

101101
func errorAsJSON(err Error) []byte {
102+
//nolint:errchkjson
102103
b, _ := json.Marshal(struct {
103104
Code int32 `json:"code"`
104105
Message string `json:"message"`
@@ -146,7 +147,7 @@ func ServeError(rw http.ResponseWriter, r *http.Request, err error) {
146147
ServeError(rw, r, nil)
147148
}
148149
case *MethodNotAllowedError:
149-
rw.Header().Add("Allow", strings.Join(err.(*MethodNotAllowedError).Allowed, ","))
150+
rw.Header().Add("Allow", strings.Join(e.Allowed, ","))
150151
rw.WriteHeader(asHTTPCode(int(e.Code())))
151152
if r == nil || r.Method != http.MethodHead {
152153
_, _ = rw.Write(errorAsJSON(e))

doc.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
// limitations under the License.
1414

1515
/*
16-
1716
Package errors provides an Error interface and several concrete types
1817
implementing this interface to manage API errors and JSON-schema validation
1918
errors.
@@ -23,6 +22,5 @@ it defines.
2322
2423
It is used throughout the various go-openapi toolkit libraries
2524
(https://github.com/go-openapi).
26-
2725
*/
2826
package errors

middleware.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ type APIVerificationFailed struct {
2828
MissingRegistration []string `json:"missingRegistration,omitempty"`
2929
}
3030

31-
//
3231
func (v *APIVerificationFailed) Error() string {
3332
buf := bytes.NewBuffer(nil)
3433

0 commit comments

Comments
 (0)