Skip to content

Commit af90337

Browse files
committed
Update to version 12.1.1 (context.FindClosest)
Former-commit-id: a57d18bab865a7c40b806c7fd2cd4ce1a259699c
1 parent a3f944b commit af90337

File tree

8 files changed

+37
-6
lines changed

8 files changed

+37
-6
lines changed

HISTORY.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,33 @@ Developers are not forced to upgrade if they don't really need it. Upgrade whene
2121

2222
**How to upgrade**: Open your command-line and execute this command: `go get github.com/kataras/iris/v12@latest`.
2323

24+
# Mo, 16 December 2019 | v12.1.1
25+
26+
Add [Context.FindClosest(n int) []string](https://github.com/kataras/iris/blob/master/_examples/routing/not-found-suggests/main.go#L22)
27+
28+
```go
29+
app := iris.New()
30+
app.OnErrorCode(iris.StatusNotFound, notFound)
31+
```
32+
33+
```go
34+
func notFound(ctx iris.Context) {
35+
suggestPaths := ctx.FindClosest(3)
36+
if len(suggestPaths) == 0 {
37+
ctx.WriteString("404 not found")
38+
return
39+
}
40+
41+
ctx.HTML("Did you mean?<ul>")
42+
for _, s := range suggestPaths {
43+
ctx.HTML(`<li><a href="%s">%s</a></li>`, s, s)
44+
}
45+
ctx.HTML("</ul>")
46+
}
47+
```
48+
49+
![](https://iris-go.com/images/iris-not-found-suggests.png)
50+
2451
# Fr, 13 December 2019 | v12.1.0
2552

2653
## Breaking Changes

HISTORY_ES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ Los desarrolladores no están obligados a actualizar si realmente no lo necesita
2121

2222
**Cómo actualizar**: Abra su línea de comandos y ejecute este comando: `go get github.com/kataras/iris/v12@latest`.
2323

24+
# Mo, 16 December 2019 | v12.1.1
25+
26+
Not translated yet, please navigate to the [english version](HISTORY.md#mo-16-december-2019--v1211) instead.
27+
2428
# Fr, 13 December 2019 | v12.1.0
2529

2630
Not translated yet, please navigate to the [english version](HISTORY.md#fr-13-december-2019--v1210) instead.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
12.1.0:https://github.com/kataras/iris/releases/tag/v12.1.0
1+
12.1.1:https://github.com/kataras/iris/releases/tag/v12.1.1

_examples/apidoc/yaag/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ go 1.13
44

55
require (
66
github.com/betacraft/yaag v1.0.1-0.20191027021412-565f65e36090
7-
github.com/kataras/iris/v12 v12.1.0
7+
github.com/kataras/iris/v12 v12.1.1
88
)

_examples/websocket/socketio/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ go 1.13
44

55
require (
66
github.com/googollee/go-socket.io v1.4.3-0.20191109153049-7451e2f8c2e0 // indirect
7-
github.com/kataras/iris/v12 v12.1.0
7+
github.com/kataras/iris/v12 v12.1.1
88
)

configuration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import (
1414
"runtime"
1515
"strings"
1616

17-
"github.com/kataras/iris/core/netutil"
1817
"github.com/kataras/iris/v12/context"
18+
"github.com/kataras/iris/v12/core/netutil"
1919

2020
"github.com/BurntSushi/toml"
2121
"github.com/kataras/sitemap"

doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Source code and other details for the project are available at GitHub:
3838
3939
Current Version
4040
41-
12.1.0
41+
12.1.1
4242
4343
Installation
4444

iris.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import (
3939
)
4040

4141
// Version is the current version number of the Iris Web Framework.
42-
const Version = "12.1.0"
42+
const Version = "12.1.1"
4343

4444
// HTTP status codes as registered with IANA.
4545
// See: http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml.

0 commit comments

Comments
 (0)