diff --git a/_examples/sessions/database/boltdb/main.go b/_examples/sessions/database/boltdb/main.go index d49c72dc7..d94b5a9d3 100644 --- a/_examples/sessions/database/boltdb/main.go +++ b/_examples/sessions/database/boltdb/main.go @@ -1,6 +1,7 @@ package main import ( + "errors" "os" "time" @@ -91,9 +92,9 @@ func main() { app.Get("/update", func(ctx iris.Context) { // updates resets the expiration based on the session's `Expires` field. if err := sess.ShiftExpiration(ctx); err != nil { - if sessions.ErrNotFound.Equal(err) { + if errors.Is(err, sessions.ErrNotFound) { ctx.StatusCode(iris.StatusNotFound) - } else if sessions.ErrNotImplemented.Equal(err) { + } else if errors.Is(err, sessions.ErrNotImplemented) { ctx.StatusCode(iris.StatusNotImplemented) } else { ctx.StatusCode(iris.StatusNotModified) diff --git a/_examples/sessions/database/redis/main.go b/_examples/sessions/database/redis/main.go index 82c9d8afb..87185a172 100644 --- a/_examples/sessions/database/redis/main.go +++ b/_examples/sessions/database/redis/main.go @@ -1,6 +1,7 @@ package main import ( + "errors" "time" "github.com/kataras/iris/v12" @@ -127,9 +128,9 @@ func main() { app.Get("/update", func(ctx iris.Context) { // updates resets the expiration based on the session's `Expires` field. if err := sess.ShiftExpiration(ctx); err != nil { - if sessions.ErrNotFound.Equal(err) { + if errors.Is(err, sessions.ErrNotFound) { ctx.StatusCode(iris.StatusNotFound) - } else if sessions.ErrNotImplemented.Equal(err) { + } else if errors.Is(err, sessions.ErrNotImplemented) { ctx.StatusCode(iris.StatusNotImplemented) } else { ctx.StatusCode(iris.StatusNotModified)