Skip to content

Commit

Permalink
fix ci errors
Browse files Browse the repository at this point in the history
  • Loading branch information
casualjim committed Aug 10, 2022
1 parent 685b4df commit b16ed90
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
go: [1.18, 1.19]
fail-fast: false

steps:
Expand All @@ -17,12 +18,12 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17.1
go-version: ${{ matrix.go }}

- name: Setup gotestsum
uses: autero1/[email protected]
with:
gotestsum_version: 1.7.0
gotestsum_version: 1.8.1

- name: Test
run: gotestsum --format short-verbose -- -race -timeout=20m -coverprofile=coverage_txt -covermode=atomic ./...
Expand Down
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ linters:
- cyclop
- errname
- varnamelen
- exhaustruct
- maintidx
3 changes: 2 additions & 1 deletion api.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func (m MethodNotAllowedError) MarshalJSON() ([]byte, error) {
}

func errorAsJSON(err Error) []byte {
//nolint:errchkjson
b, _ := json.Marshal(struct {
Code int32 `json:"code"`
Message string `json:"message"`
Expand Down Expand Up @@ -146,7 +147,7 @@ func ServeError(rw http.ResponseWriter, r *http.Request, err error) {
ServeError(rw, r, nil)
}
case *MethodNotAllowedError:
rw.Header().Add("Allow", strings.Join(err.(*MethodNotAllowedError).Allowed, ","))
rw.Header().Add("Allow", strings.Join(e.Allowed, ","))
rw.WriteHeader(asHTTPCode(int(e.Code())))
if r == nil || r.Method != http.MethodHead {
_, _ = rw.Write(errorAsJSON(e))
Expand Down
2 changes: 0 additions & 2 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// limitations under the License.

/*
Package errors provides an Error interface and several concrete types
implementing this interface to manage API errors and JSON-schema validation
errors.
Expand All @@ -23,6 +22,5 @@ it defines.
It is used throughout the various go-openapi toolkit libraries
(https://github.com/go-openapi).
*/
package errors
1 change: 0 additions & 1 deletion middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ type APIVerificationFailed struct {
MissingRegistration []string `json:"missingRegistration,omitempty"`
}

//
func (v *APIVerificationFailed) Error() string {
buf := bytes.NewBuffer(nil)

Expand Down

0 comments on commit b16ed90

Please sign in to comment.