From 952906eb2a617cdca2c552994fe16abdcfb1e45b Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Mon, 16 Dec 2019 06:53:42 +0200 Subject: [PATCH] update for v12.1.1 --- Installation.md | 2 +- Routing-error-handlers.md | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Installation.md b/Installation.md index 2e62941..252d7d5 100644 --- a/Installation.md +++ b/Installation.md @@ -21,7 +21,7 @@ module your_project_name go 1.13 require ( - github.com/kataras/iris/v12 v12.1.0 + github.com/kataras/iris/v12 v12.1.1 ) ``` diff --git a/Routing-error-handlers.md b/Routing-error-handlers.md index 42c7eba..e126910 100644 --- a/Routing-error-handlers.md +++ b/Routing-error-handlers.md @@ -27,6 +27,20 @@ func notFound(ctx iris.Context) { // when 404 then render the template // $views_dir/errors/404.html ctx.View("errors/404.html") + + // OR, if you had more paths and you want + // to suggest relative paths to the user: + // suggestPaths := ctx.FindClosest(3) + // if len(suggestPaths) == 0 { + // ctx.WriteString("404 not found") + // return + // } + + // ctx.HTML("Did you mean?") } func internalServerError(ctx iris.Context) {