Skip to content

Commit 630c67e

Browse files
committed
update code for go version 1.24
1 parent e5e5d6f commit 630c67e

File tree

90 files changed

+337
-167
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+337
-167
lines changed

_benchmarks/view/ace/main.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package main
22

3-
import "github.com/kataras/iris/v12"
3+
import (
4+
"fmt"
5+
6+
"github.com/kataras/iris/v12"
7+
)
48

59
func main() {
610
app := iris.New()
@@ -21,7 +25,7 @@ func index(ctx iris.Context) {
2125

2226
ctx.ViewLayout("layouts/main")
2327
if err := ctx.View("index", data); err != nil {
24-
ctx.HTML("<h3>%s</h3>", err.Error())
28+
ctx.HTML(fmt.Sprintf("<h3>%s</h3>", err.Error()))
2529
return
2630
}
2731
}

_benchmarks/view/blocks/main.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package main
22

3-
import "github.com/kataras/iris/v12"
3+
import (
4+
"fmt"
5+
6+
"github.com/kataras/iris/v12"
7+
)
48

59
func main() {
610
app := iris.New()
@@ -23,7 +27,7 @@ func index(ctx iris.Context) {
2327

2428
ctx.ViewLayout("main")
2529
if err := ctx.View("index", data); err != nil {
26-
ctx.HTML("<h3>%s</h3>", err.Error())
30+
ctx.HTML(fmt.Sprintf("<h3>%s</h3>", err.Error()))
2731
return
2832
}
2933
}

_benchmarks/view/django/main.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package main
22

3-
import "github.com/kataras/iris/v12"
3+
import (
4+
"fmt"
5+
6+
"github.com/kataras/iris/v12"
7+
)
48

59
func main() {
610
app := iris.New()
@@ -22,7 +26,7 @@ func index(ctx iris.Context) {
2226
// Layouts are only rendered from inside the index page itself
2327
// using the "extends" keyword.
2428
if err := ctx.View("index", data); err != nil {
25-
ctx.HTML("<h3>%s</h3>", err.Error())
29+
ctx.HTML(fmt.Sprintf("<h3>%s</h3>", err.Error()))
2630
return
2731
}
2832
}

_benchmarks/view/handlebars/main.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package main
22

3-
import "github.com/kataras/iris/v12"
3+
import (
4+
"fmt"
5+
6+
"github.com/kataras/iris/v12"
7+
)
48

59
func main() {
610
app := iris.New()
@@ -20,7 +24,7 @@ func index(ctx iris.Context) {
2024

2125
ctx.ViewLayout("layouts/main")
2226
if err := ctx.View("index", data); err != nil {
23-
ctx.HTML("<h3>%s</h3>", err.Error())
27+
ctx.HTML(fmt.Sprintf("<h3>%s</h3>", err.Error()))
2428
return
2529
}
2630
}

_benchmarks/view/html/main.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package main
22

3-
import "github.com/kataras/iris/v12"
3+
import (
4+
"fmt"
5+
6+
"github.com/kataras/iris/v12"
7+
)
48

59
func main() {
610
app := iris.New()
@@ -21,7 +25,7 @@ func index(ctx iris.Context) {
2125

2226
ctx.ViewLayout("layouts/main")
2327
if err := ctx.View("index", data); err != nil {
24-
ctx.HTML("<h3>%s</h3>", err.Error())
28+
ctx.HTML(fmt.Sprintf("<h3>%s</h3>", err.Error()))
2529
return
2630
}
2731
}

_benchmarks/view/jet/main.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package main
22

3-
import "github.com/kataras/iris/v12"
3+
import (
4+
"fmt"
5+
6+
"github.com/kataras/iris/v12"
7+
)
48

59
func main() {
610
app := iris.New()
@@ -22,7 +26,7 @@ func index(ctx iris.Context) {
2226
// Layouts are only rendered from inside the index page itself
2327
// using the "extends" keyword.
2428
if err := ctx.View("index", data); err != nil {
25-
ctx.HTML("<h3>%s</h3>", err.Error())
29+
ctx.HTML(fmt.Sprintf("<h3>%s</h3>", err.Error()))
2630
return
2731
}
2832
}

_benchmarks/view/pug/main.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package main
22

3-
import "github.com/kataras/iris/v12"
3+
import (
4+
"fmt"
5+
6+
"github.com/kataras/iris/v12"
7+
)
48

59
func main() {
610
app := iris.New()
@@ -23,7 +27,7 @@ func index(ctx iris.Context) {
2327
// Layouts are only rendered from inside the index page itself
2428
// using the "extends" keyword.
2529
if err := ctx.View("index", data); err != nil {
26-
ctx.HTML("<h3>%s</h3>", err.Error())
30+
ctx.HTML(fmt.Sprintf("<h3>%s</h3>", err.Error()))
2731
return
2832
}
2933
}

_examples/auth/auth/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func main() {
119119

120120
func renderSigninForm(ctx iris.Context) {
121121
if err := ctx.View("signin", iris.Map{"Title": "Signin Page"}); err != nil {
122-
ctx.HTML("<h3>%s</h3>", err.Error())
122+
ctx.HTML(fmt.Sprintf("<h3>%s</h3>", err.Error()))
123123
return
124124
}
125125
}

_examples/auth/goth/main.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ package main
2121
// are fixed in the time I wrote that example, have fun!
2222
import (
2323
"errors"
24+
"fmt"
2425
"os"
2526
"sort"
2627

@@ -380,7 +381,7 @@ func main() {
380381
if err := ctx.View("user.html", iris.Map{
381382
"user": user,
382383
}); err != nil {
383-
ctx.HTML("<h3>%s</h3>", err.Error())
384+
ctx.HTML(fmt.Sprintf("<h3>%s</h3>", err.Error()))
384385
return
385386
}
386387
})
@@ -399,14 +400,14 @@ func main() {
399400
}
400401

401402
if err := ctx.View("user.html", gothUser); err != nil {
402-
ctx.HTML("<h3>%s</h3>", err.Error())
403+
ctx.HTML(fmt.Sprintf("<h3>%s</h3>", err.Error()))
403404
return
404405
}
405406
})
406407

407408
app.Get("/", func(ctx iris.Context) {
408409
if err := ctx.View("index.html", providerIndex); err != nil {
409-
ctx.HTML("<h3>%s</h3>", err.Error())
410+
ctx.HTML(fmt.Sprintf("<h3>%s</h3>", err.Error()))
410411
return
411412
}
412413
})

_examples/auth/hcaptcha/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package main
22

33
import (
4+
"fmt"
45
"os"
56

67
"github.com/kataras/iris/v12"
@@ -43,7 +44,7 @@ func register(ctx iris.Context) {
4344
func registerForm(ctx iris.Context) {
4445
ctx.ViewData("SiteKey", siteKey)
4546
if err := ctx.View("register_form.html"); err != nil {
46-
ctx.HTML("<h3>%s</h3>", err.Error())
47+
ctx.HTML(fmt.Sprintf("<h3>%s</h3>", err.Error()))
4748
return
4849
}
4950
}

0 commit comments

Comments
 (0)