mirror of
https://github.com/kataras/iris.git
synced 2025-02-02 07:20:35 +01:00
Update to version 12.1.1 (context.FindClosest)
Former-commit-id: a57d18bab865a7c40b806c7fd2cd4ce1a259699c
This commit is contained in:
parent
a3f944b884
commit
af90337cfd
27
HISTORY.md
27
HISTORY.md
|
@ -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`.
|
||||
|
||||
# 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
|
||||
|
||||
## Breaking Changes
|
||||
|
|
|
@ -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`.
|
||||
|
||||
# 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
|
||||
|
||||
Not translated yet, please navigate to the [english version](HISTORY.md#fr-13-december-2019--v1210) instead.
|
||||
|
|
2
VERSION
2
VERSION
|
@ -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
|
|
@ -4,5 +4,5 @@ go 1.13
|
|||
|
||||
require (
|
||||
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
|
||||
)
|
||||
|
|
|
@ -4,5 +4,5 @@ go 1.13
|
|||
|
||||
require (
|
||||
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
|
||||
)
|
||||
|
|
|
@ -14,8 +14,8 @@ import (
|
|||
"runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/kataras/iris/core/netutil"
|
||||
"github.com/kataras/iris/v12/context"
|
||||
"github.com/kataras/iris/v12/core/netutil"
|
||||
|
||||
"github.com/BurntSushi/toml"
|
||||
"github.com/kataras/sitemap"
|
||||
|
|
2
doc.go
2
doc.go
|
@ -38,7 +38,7 @@ Source code and other details for the project are available at GitHub:
|
|||
|
||||
Current Version
|
||||
|
||||
12.1.0
|
||||
12.1.1
|
||||
|
||||
Installation
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user