Skip to content
Snippets Groups Projects
Unverified Commit b16ed90f authored by Ivan Porto Carrero's avatar Ivan Porto Carrero
Browse files

fix ci errors

parent 685b4df4
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,7 @@ jobs: ...@@ -9,6 +9,7 @@ jobs:
strategy: strategy:
matrix: matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ] os: [ ubuntu-latest, macos-latest, windows-latest ]
go: [1.18, 1.19]
fail-fast: false fail-fast: false
steps: steps:
...@@ -17,12 +18,12 @@ jobs: ...@@ -17,12 +18,12 @@ jobs:
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v2 uses: actions/setup-go@v2
with: with:
go-version: 1.17.1 go-version: ${{ matrix.go }}
- name: Setup gotestsum - name: Setup gotestsum
uses: autero1/action-gotestsum@v1.0.0 uses: autero1/action-gotestsum@v1.0.0
with: with:
gotestsum_version: 1.7.0 gotestsum_version: 1.8.1
- name: Test - name: Test
run: gotestsum --format short-verbose -- -race -timeout=20m -coverprofile=coverage_txt -covermode=atomic ./... run: gotestsum --format short-verbose -- -race -timeout=20m -coverprofile=coverage_txt -covermode=atomic ./...
......
...@@ -44,3 +44,5 @@ linters: ...@@ -44,3 +44,5 @@ linters:
- cyclop - cyclop
- errname - errname
- varnamelen - varnamelen
- exhaustruct
- maintidx
...@@ -99,6 +99,7 @@ func (m MethodNotAllowedError) MarshalJSON() ([]byte, error) { ...@@ -99,6 +99,7 @@ func (m MethodNotAllowedError) MarshalJSON() ([]byte, error) {
} }
func errorAsJSON(err Error) []byte { func errorAsJSON(err Error) []byte {
//nolint:errchkjson
b, _ := json.Marshal(struct { b, _ := json.Marshal(struct {
Code int32 `json:"code"` Code int32 `json:"code"`
Message string `json:"message"` Message string `json:"message"`
...@@ -146,7 +147,7 @@ func ServeError(rw http.ResponseWriter, r *http.Request, err error) { ...@@ -146,7 +147,7 @@ func ServeError(rw http.ResponseWriter, r *http.Request, err error) {
ServeError(rw, r, nil) ServeError(rw, r, nil)
} }
case *MethodNotAllowedError: 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()))) rw.WriteHeader(asHTTPCode(int(e.Code())))
if r == nil || r.Method != http.MethodHead { if r == nil || r.Method != http.MethodHead {
_, _ = rw.Write(errorAsJSON(e)) _, _ = rw.Write(errorAsJSON(e))
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
// limitations under the License. // limitations under the License.
/* /*
Package errors provides an Error interface and several concrete types Package errors provides an Error interface and several concrete types
implementing this interface to manage API errors and JSON-schema validation implementing this interface to manage API errors and JSON-schema validation
errors. errors.
...@@ -23,6 +22,5 @@ it defines. ...@@ -23,6 +22,5 @@ it defines.
It is used throughout the various go-openapi toolkit libraries It is used throughout the various go-openapi toolkit libraries
(https://github.com/go-openapi). (https://github.com/go-openapi).
*/ */
package errors package errors
...@@ -28,7 +28,6 @@ type APIVerificationFailed struct { ...@@ -28,7 +28,6 @@ type APIVerificationFailed struct {
MissingRegistration []string `json:"missingRegistration,omitempty"` MissingRegistration []string `json:"missingRegistration,omitempty"`
} }
//
func (v *APIVerificationFailed) Error() string { func (v *APIVerificationFailed) Error() string {
buf := bytes.NewBuffer(nil) buf := bytes.NewBuffer(nil)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment