mirror of
https://github.com/kataras/iris.git
synced 2025-12-20 19:37:03 +00:00
update dependencies
This commit is contained in:
@@ -78,7 +78,7 @@ func newApp() *iris.Application {
|
||||
return
|
||||
}
|
||||
|
||||
ctx.JSON(map[string]interface{}{
|
||||
ctx.JSON(map[string]any{
|
||||
// you can pass any custom structured go value of course.
|
||||
"user_id": userID,
|
||||
})
|
||||
|
||||
@@ -35,7 +35,7 @@ func TestRoutingBasic(t *testing.T) {
|
||||
expectedUUintResponse = expectedUResponse("uid", "uint", "42")
|
||||
expectedUAlphabeticalResponse = expectedUResponse("firstname", "alphabetical", "abcd")
|
||||
|
||||
expectedAPIUsersIndexResponse = map[string]interface{}{"user_id": 42}
|
||||
expectedAPIUsersIndexResponse = map[string]any{"user_id": 42}
|
||||
|
||||
expectedAdminIndexResponse = "<h1>Hello from admin/</h1>"
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ func (c *myCustomContext) SetContext(ctx iris.Context) {
|
||||
c.Context = ctx
|
||||
}
|
||||
|
||||
func (c *myCustomContext) HTML(format string, args ...interface{}) (int, error) {
|
||||
func (c *myCustomContext) HTML(format string, args ...any) (int, error) {
|
||||
c.Application().Logger().Info("HTML was called from custom Context")
|
||||
|
||||
return c.Context.HTML(fmt.Sprintf(format, args...))
|
||||
|
||||
@@ -112,6 +112,6 @@ func problemExample(ctx iris.Context) {
|
||||
// retry-after based on the request. Useful for ProblemOptions reusability.
|
||||
// Overrides the RetryAfter field.
|
||||
//
|
||||
// RetryAfterFunc: func(iris.Context) interface{} { [...] }
|
||||
// RetryAfterFunc: func(iris.Context) any { [...] }
|
||||
})
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ func main() {
|
||||
app := iris.New()
|
||||
app.Logger().SetLevel("debug")
|
||||
|
||||
app.Macros().Register("slice", "", []string{}, false, true, func(paramValue string) (interface{}, bool) {
|
||||
app.Macros().Register("slice", "", []string{}, false, true, func(paramValue string) (any, bool) {
|
||||
return strings.Split(paramValue, "/"), true
|
||||
}).RegisterFunc("contains", func(expectedItems []string) func(paramValue []string) bool {
|
||||
sort.Strings(expectedItems)
|
||||
@@ -39,10 +39,10 @@ func main() {
|
||||
|
||||
// In order to use your new param type inside MVC controller's function input argument or a hero function input argument
|
||||
// you have to tell the Iris what type it is, the `ValueRaw` of the parameter is the same type
|
||||
// as you defined it above with the func(paramValue string) (interface{}, bool).
|
||||
// as you defined it above with the func(paramValue string) (any, bool).
|
||||
// The new value and its type(from string to your new custom type) it is stored only once now,
|
||||
// you don't have to do any conversions for simple cases like this.
|
||||
context.ParamResolvers[reflect.TypeOf([]string{})] = func(paramIndex int) interface{} {
|
||||
context.ParamResolvers[reflect.TypeOf([]string{})] = func(paramIndex int) any {
|
||||
return func(ctx iris.Context) []string {
|
||||
// When you want to retrieve a parameter with a value type that it is not supported by-default, such as ctx.Params().GetInt
|
||||
// then you can use the `GetEntry` or `GetEntryAt` and cast its underline `ValueRaw` to the desired type.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module github.com/kataras/iris/_examples/routing/party-controller
|
||||
|
||||
go 1.24.3
|
||||
go 1.25
|
||||
|
||||
require github.com/kataras/iris/v12 v12.2.11-0.20250430051100-af9c8213980c
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module github.com/kataras/iris/_examples/routing/subdomains/redirect/multi-instances
|
||||
|
||||
go 1.24.3
|
||||
go 1.25
|
||||
|
||||
require github.com/kataras/iris/v12 v12.2.11-0.20250430051100-af9c8213980c
|
||||
|
||||
|
||||
Reference in New Issue
Block a user