Skip to content

Commit

Permalink
Update route_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
KlassnayaAfrodita authored Dec 26, 2024
1 parent 46fc772 commit 48144d5
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions route_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,8 @@ func TestRecoverWithCustomCallback(t *testing.T) {
route, err := NewRoute(mockConfig, nil)
assert.Nil(t, err)

globalRecover := func(ctx context.Context, err any) {
httpCtx, ok := ctx.(contractshttp.Context)
if !ok {
t.Fatalf("invalid context type: %T", ctx)
return
}
httpCtx.Request().AbortWithStatusJson(http.StatusInternalServerError, gin.H{"error": "Internal Panic"})
globalRecover := func(ctx contractshttp.Context, err any) {
ctx.Request().AbortWithStatusJson(http.StatusInternalServerError, gin.H{"error": "Internal Panic"})
}

route.Recover(globalRecover)

Check failure on line 41 in route_test.go

View workflow job for this annotation

GitHub Actions / codecov / codecov

cannot use globalRecover (variable of type func(ctx "github.com/goravel/framework/contracts/http".Context, err any)) as func(ctx context.Context, err any) value in argument to route.Recover

Check failure on line 41 in route_test.go

View workflow job for this annotation

GitHub Actions / lint / lint

cannot use globalRecover (variable of type func(ctx "github.com/goravel/framework/contracts/http".Context, err any)) as func(ctx context.Context, err any) value in argument to route.Recover (typecheck)

Check failure on line 41 in route_test.go

View workflow job for this annotation

GitHub Actions / test / ubuntu (1.22)

cannot use globalRecover (variable of type func(ctx "github.com/goravel/framework/contracts/http".Context, err any)) as func(ctx context.Context, err any) value in argument to route.Recover

Check failure on line 41 in route_test.go

View workflow job for this annotation

GitHub Actions / test / ubuntu (1.23)

cannot use globalRecover (variable of type func(ctx "github.com/goravel/framework/contracts/http".Context, err any)) as func(ctx context.Context, err any) value in argument to route.Recover

Check failure on line 41 in route_test.go

View workflow job for this annotation

GitHub Actions / test / windows (1.22)

cannot use globalRecover (variable of type func(ctx "github.com/goravel/framework/contracts/http".Context, err any)) as func(ctx context.Context, err any) value in argument to route.Recover
Expand Down

0 comments on commit 48144d5

Please sign in to comment.