Skip to content

Commit b5ca5cb

Browse files
committed
style: use any over interface{}
1 parent d109c1a commit b5ca5cb

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

oapi_validate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ type Options struct {
7070
ErrorHandler ErrorHandler
7171
Options openapi3filter.Options
7272
ParamDecoder openapi3filter.ContentParameterDecoder
73-
UserData interface{}
73+
UserData any
7474
Skipper echomiddleware.Skipper
7575
MultiErrorHandler MultiErrorHandler
7676
// SilenceServersWarning allows silencing a warning for https://github.com/deepmap/oapi-codegen/issues/882 that reports when an OpenAPI spec has `spec.Servers != nil`
@@ -202,7 +202,7 @@ func GetEchoContext(c context.Context) echo.Context {
202202
return eCtx
203203
}
204204

205-
func GetUserData(c context.Context) interface{} {
205+
func GetUserData(c context.Context) any {
206206
return c.Value(UserDataKey)
207207
}
208208

oapi_validate_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func doGet(t *testing.T, e *echo.Echo, rawURL string) *httptest.ResponseRecorder
5757
return tt
5858
}
5959

60-
func doPost(t *testing.T, e *echo.Echo, rawURL string, jsonBody interface{}) *httptest.ResponseRecorder {
60+
func doPost(t *testing.T, e *echo.Echo, rawURL string, jsonBody any) *httptest.ResponseRecorder {
6161
u, err := url.Parse(rawURL)
6262
if err != nil {
6363
t.Fatalf("Invalid url: %s", rawURL)

0 commit comments

Comments
 (0)