Update to version 12.1.1 (context.FindClosest)

Former-commit-id: a57d18bab865a7c40b806c7fd2cd4ce1a259699c
This commit is contained in:
Gerasimos (Makis) Maropoulos 2019-12-16 06:50:36 +02:00
parent a3f944b884
commit af90337cfd
8 changed files with 37 additions and 6 deletions

View File

@ -21,6 +21,33 @@ Developers are not forced to upgrade if they don't really need it. Upgrade whene
**How to upgrade**: Open your command-line and execute this command: `go get github.com/kataras/iris/v12@latest`. **How to upgrade**: Open your command-line and execute this command: `go get github.com/kataras/iris/v12@latest`.
# Mo, 16 December 2019 | v12.1.1
Add [Context.FindClosest(n int) []string](https://github.com/kataras/iris/blob/master/_examples/routing/not-found-suggests/main.go#L22)
```go
app := iris.New()
app.OnErrorCode(iris.StatusNotFound, notFound)
```
```go
func notFound(ctx iris.Context) {
suggestPaths := ctx.FindClosest(3)
if len(suggestPaths) == 0 {
ctx.WriteString("404 not found")
return
}
ctx.HTML("Did you mean?<ul>")
for _, s := range suggestPaths {
ctx.HTML(`<li><a href="%s">%s</a></li>`, s, s)
}
ctx.HTML("</ul>")
}
```
![](https://iris-go.com/images/iris-not-found-suggests.png)
# Fr, 13 December 2019 | v12.1.0 # Fr, 13 December 2019 | v12.1.0
## Breaking Changes ## Breaking Changes

View File

@ -21,6 +21,10 @@ Los desarrolladores no están obligados a actualizar si realmente no lo necesita
**Cómo actualizar**: Abra su línea de comandos y ejecute este comando: `go get github.com/kataras/iris/v12@latest`. **Cómo actualizar**: Abra su línea de comandos y ejecute este comando: `go get github.com/kataras/iris/v12@latest`.
# Mo, 16 December 2019 | v12.1.1
Not translated yet, please navigate to the [english version](HISTORY.md#mo-16-december-2019--v1211) instead.
# Fr, 13 December 2019 | v12.1.0 # Fr, 13 December 2019 | v12.1.0
Not translated yet, please navigate to the [english version](HISTORY.md#fr-13-december-2019--v1210) instead. Not translated yet, please navigate to the [english version](HISTORY.md#fr-13-december-2019--v1210) instead.

View File

@ -1 +1 @@
12.1.0:https://github.com/kataras/iris/releases/tag/v12.1.0 12.1.1:https://github.com/kataras/iris/releases/tag/v12.1.1

View File

@ -4,5 +4,5 @@ go 1.13
require ( require (
github.com/betacraft/yaag v1.0.1-0.20191027021412-565f65e36090 github.com/betacraft/yaag v1.0.1-0.20191027021412-565f65e36090
github.com/kataras/iris/v12 v12.1.0 github.com/kataras/iris/v12 v12.1.1
) )

View File

@ -4,5 +4,5 @@ go 1.13
require ( require (
github.com/googollee/go-socket.io v1.4.3-0.20191109153049-7451e2f8c2e0 // indirect github.com/googollee/go-socket.io v1.4.3-0.20191109153049-7451e2f8c2e0 // indirect
github.com/kataras/iris/v12 v12.1.0 github.com/kataras/iris/v12 v12.1.1
) )

View File

@ -14,8 +14,8 @@ import (
"runtime" "runtime"
"strings" "strings"
"github.com/kataras/iris/core/netutil"
"github.com/kataras/iris/v12/context" "github.com/kataras/iris/v12/context"
"github.com/kataras/iris/v12/core/netutil"
"github.com/BurntSushi/toml" "github.com/BurntSushi/toml"
"github.com/kataras/sitemap" "github.com/kataras/sitemap"

2
doc.go
View File

@ -38,7 +38,7 @@ Source code and other details for the project are available at GitHub:
Current Version Current Version
12.1.0 12.1.1
Installation Installation

View File

@ -39,7 +39,7 @@ import (
) )
// Version is the current version number of the Iris Web Framework. // Version is the current version number of the Iris Web Framework.
const Version = "12.1.0" const Version = "12.1.1"
// HTTP status codes as registered with IANA. // HTTP status codes as registered with IANA.
// See: http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml. // See: http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml.