Skip to content

Commit

Permalink
Update to version 12.1.1 (context.FindClosest)
Browse files Browse the repository at this point in the history
Former-commit-id: a57d18bab865a7c40b806c7fd2cd4ce1a259699c
  • Loading branch information
kataras committed Dec 16, 2019
1 parent a3f944b commit af90337
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 6 deletions.
27 changes: 27 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions HISTORY_ES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion _examples/apidoc/yaag/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
2 changes: 1 addition & 1 deletion _examples/websocket/socketio/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
2 changes: 1 addition & 1 deletion configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion iris.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (
)

// 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.
// See: http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml.
Expand Down

0 comments on commit af90337

Please sign in to comment.