mirror of
https://github.com/kataras/iris.git
synced 2025-12-24 05:17:03 +00:00
update code for go version 1.24
This commit is contained in:
@@ -95,7 +95,7 @@ func uploadView(ctx iris.Context) {
|
||||
token := fmt.Sprintf("%x", h.Sum(nil))
|
||||
|
||||
if err := ctx.View("upload.html", token); err != nil {
|
||||
ctx.HTML("<h3>%s</h3>", err.Error())
|
||||
ctx.HTML(fmt.Sprintf("<h3>%s</h3>", err.Error()))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
)
|
||||
|
||||
@@ -27,7 +29,7 @@ func newApp() *iris.Application {
|
||||
app.Get("/", func(ctx iris.Context) {
|
||||
ctx.ViewData("Page", page)
|
||||
if err := ctx.View("index.html"); err != nil {
|
||||
ctx.HTML("<h3>%s</h3>", err.Error())
|
||||
ctx.HTML(fmt.Sprintf("<h3>%s</h3>", err.Error()))
|
||||
return
|
||||
}
|
||||
})
|
||||
|
||||
@@ -28,7 +28,7 @@ func fullVueRouter() {
|
||||
|
||||
func index(ctx iris.Context) {
|
||||
if err := ctx.View("index.html"); err != nil {
|
||||
ctx.HTML("<h3>%s</h3>", err.Error())
|
||||
ctx.HTML(fmt.Sprintf("<h3>%s</h3>", err.Error()))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ func main() {
|
||||
// or add second argument to the `View` method.
|
||||
// Token will be passed as {{.}} in the template.
|
||||
if err := ctx.View("upload_form.html", token); err != nil {
|
||||
ctx.HTML("<h3>%s</h3>", err.Error())
|
||||
ctx.HTML(fmt.Sprintf("<h3>%s</h3>", err.Error()))
|
||||
return
|
||||
}
|
||||
})
|
||||
|
||||
@@ -33,7 +33,7 @@ func newApp() *iris.Application {
|
||||
|
||||
// render the form with the token for any use you'd like.
|
||||
if err := ctx.View("upload_form.html", token); err != nil {
|
||||
ctx.HTML("<h3>%s</h3>", err.Error())
|
||||
ctx.HTML(fmt.Sprintf("<h3>%s</h3>", err.Error()))
|
||||
return
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user