1
0
mirror of https://github.com/kataras/iris.git synced 2026-05-14 18:13:49 +00:00

CI: minor: use the new exclude-paths (dependabot PR approved some days ago)

This commit is contained in:
Gerasimos (Makis) Maropoulos
2025-08-16 22:48:38 +03:00
parent a8a3afea22
commit 92164cee52
37 changed files with 268 additions and 266 deletions

View File

@@ -360,7 +360,7 @@ func (api *APIBuilder) EnsureStaticBindings() Party {
// RegisterDependency calls the `ConfigureContainer.RegisterDependency` method
// with the provided value(s). See `HandleFunc` and `PartyConfigure` methods too.
func (api *APIBuilder) RegisterDependency(dependencies ...interface{}) {
func (api *APIBuilder) RegisterDependency(dependencies ...any) {
diContainer := api.ConfigureContainer()
for i, dependency := range dependencies {
if dependency == nil {
@@ -442,7 +442,7 @@ func (api *APIBuilder) RegisterDependency(dependencies ...interface{}) {
// the dependency injection, mvc and function handlers.
//
// This method is just a shortcut of the `ConfigureContainer().Handle`.
func (api *APIBuilder) HandleFunc(method, relativePath string, handlersFn ...interface{}) *Route {
func (api *APIBuilder) HandleFunc(method, relativePath string, handlersFn ...any) *Route {
return api.ConfigureContainer().Handle(method, relativePath, handlersFn...)
}
@@ -451,7 +451,7 @@ func (api *APIBuilder) HandleFunc(method, relativePath string, handlersFn ...int
// or a result of <T> and/or an error.
//
// This method is just a shortcut of the `ConfigureContainer().Use`.
func (api *APIBuilder) UseFunc(handlersFn ...interface{}) {
func (api *APIBuilder) UseFunc(handlersFn ...any) {
api.ConfigureContainer().Use(handlersFn...)
}
@@ -636,7 +636,7 @@ func (api *APIBuilder) HandleMany(methodOrMulti string, relativePathorMulti stri
//
// Examples:
// https://github.com/kataras/iris/tree/main/_examples/file-server
func (api *APIBuilder) HandleDir(requestPath string, fsOrDir interface{}, opts ...DirOptions) (routes []*Route) {
func (api *APIBuilder) HandleDir(requestPath string, fsOrDir any, opts ...DirOptions) (routes []*Route) {
options := DefaultDirOptions
if len(opts) > 0 {
options = opts[0]
@@ -1401,7 +1401,7 @@ func (api *APIBuilder) MiddlewareExists(handlerNameOrFunc any) bool {
// Returns the Party itself for chain calls.
//
// Should be called before children routes regitration.
func (api *APIBuilder) RemoveHandler(namesOrHandlers ...interface{}) Party {
func (api *APIBuilder) RemoveHandler(namesOrHandlers ...any) Party {
var counter *int
for _, nameOrHandler := range namesOrHandlers {

View File

@@ -20,7 +20,7 @@ type APIContainer struct {
// Party returns a child of this `APIContainer` featured with Dependency Injection.
// Like the `Self.Party` method does for the common Router Groups.
func (api *APIContainer) Party(relativePath string, handlersFn ...interface{}) *APIContainer {
func (api *APIContainer) Party(relativePath string, handlersFn ...any) *APIContainer {
handlers := api.convertHandlerFuncs(relativePath, handlersFn...)
p := api.Self.Party(relativePath, handlers...)
return p.ConfigureContainer()
@@ -67,7 +67,7 @@ func (api *APIContainer) OnError(errorHandler func(*context.Context, error)) {
// - RegisterDependency(func(User) OtherResponse {...})
//
// See `OnError`, `Use`, `Done` and `Handle` too.
func (api *APIContainer) RegisterDependency(dependency interface{}) *hero.Dependency {
func (api *APIContainer) RegisterDependency(dependency any) *hero.Dependency {
return api.Container.Register(dependency)
}
@@ -117,7 +117,7 @@ func (api *APIContainer) SetDependencyMatcher(fn hero.DependencyMatcher) *APICon
}
// convertHandlerFuncs accepts Iris hero handlers and returns a slice of native Iris handlers.
func (api *APIContainer) convertHandlerFuncs(relativePath string, handlersFn ...interface{}) context.Handlers {
func (api *APIContainer) convertHandlerFuncs(relativePath string, handlersFn ...any) context.Handlers {
fullpath := api.Self.GetRelPath() + relativePath
paramsCount := macro.CountParams(fullpath, *api.Self.Macros())
@@ -136,7 +136,7 @@ func (api *APIContainer) convertHandlerFuncs(relativePath string, handlersFn ...
return handlers
}
func fixRouteInfo(route *Route, handlersFn []interface{}) {
func fixRouteInfo(route *Route, handlersFn []any) {
// Fix main handler name and source modified by execution rules wrapper.
route.MainHandlerName, route.MainHandlerIndex = context.MainHandlerName(handlersFn...)
if len(handlersFn) > route.MainHandlerIndex {
@@ -147,7 +147,7 @@ func fixRouteInfo(route *Route, handlersFn []interface{}) {
// Handler receives a function which can receive dependencies and output result
// and returns a common Iris Handler, useful for Versioning API integration otherwise
// the `Handle/Get/Post...` methods are preferable.
func (api *APIContainer) Handler(handlerFn interface{}, handlerParamsCount int) context.Handler {
func (api *APIContainer) Handler(handlerFn any, handlerParamsCount int) context.Handler {
paramsCount := macro.CountParams(api.Self.GetRelPath(), *api.Self.Macros()) + handlerParamsCount
return api.Container.HandlerWithParams(handlerFn, paramsCount)
}
@@ -155,14 +155,14 @@ func (api *APIContainer) Handler(handlerFn interface{}, handlerParamsCount int)
// Use same as `Self.Use` but it accepts dynamic functions as its "handlersFn" input.
//
// See `OnError`, `RegisterDependency`, `Done` and `Handle` for more.
func (api *APIContainer) Use(handlersFn ...interface{}) {
func (api *APIContainer) Use(handlersFn ...any) {
handlers := api.convertHandlerFuncs("/", handlersFn...)
api.Self.Use(handlers...)
}
// Done same as `Self.Done` but it accepts dynamic functions as its "handlersFn" input.
// See `OnError`, `RegisterDependency`, `Use` and `Handle` for more.
func (api *APIContainer) Done(handlersFn ...interface{}) {
func (api *APIContainer) Done(handlersFn ...any) {
handlers := api.convertHandlerFuncs("/", handlersFn...)
api.Self.Done(handlers...)
}
@@ -178,7 +178,7 @@ func (api *APIContainer) Done(handlersFn ...interface{}) {
// the end-developer should output an error and return `iris.ErrStopExecution`.
//
// See `OnError`, `RegisterDependency`, `Use`, `Done`, `Get`, `Post`, `Put`, `Patch` and `Delete` too.
func (api *APIContainer) Handle(method, relativePath string, handlersFn ...interface{}) *Route {
func (api *APIContainer) Handle(method, relativePath string, handlersFn ...any) *Route {
handlers := api.convertHandlerFuncs(relativePath, handlersFn...)
route := api.Self.Handle(method, relativePath, handlers...)
fixRouteInfo(route, handlersFn)
@@ -188,63 +188,63 @@ func (api *APIContainer) Handle(method, relativePath string, handlersFn ...inter
// Get registers a route for the Get HTTP Method.
//
// Returns a *Route and an error which will be filled if route wasn't registered successfully.
func (api *APIContainer) Get(relativePath string, handlersFn ...interface{}) *Route {
func (api *APIContainer) Get(relativePath string, handlersFn ...any) *Route {
return api.Handle(http.MethodGet, relativePath, handlersFn...)
}
// Post registers a route for the Post HTTP Method.
//
// Returns a *Route and an error which will be filled if route wasn't registered successfully.
func (api *APIContainer) Post(relativePath string, handlersFn ...interface{}) *Route {
func (api *APIContainer) Post(relativePath string, handlersFn ...any) *Route {
return api.Handle(http.MethodPost, relativePath, handlersFn...)
}
// Put registers a route for the Put HTTP Method.
//
// Returns a *Route and an error which will be filled if route wasn't registered successfully.
func (api *APIContainer) Put(relativePath string, handlersFn ...interface{}) *Route {
func (api *APIContainer) Put(relativePath string, handlersFn ...any) *Route {
return api.Handle(http.MethodPut, relativePath, handlersFn...)
}
// Delete registers a route for the Delete HTTP Method.
//
// Returns a *Route and an error which will be filled if route wasn't registered successfully.
func (api *APIContainer) Delete(relativePath string, handlersFn ...interface{}) *Route {
func (api *APIContainer) Delete(relativePath string, handlersFn ...any) *Route {
return api.Handle(http.MethodDelete, relativePath, handlersFn...)
}
// Connect registers a route for the Connect HTTP Method.
//
// Returns a *Route and an error which will be filled if route wasn't registered successfully.
func (api *APIContainer) Connect(relativePath string, handlersFn ...interface{}) *Route {
func (api *APIContainer) Connect(relativePath string, handlersFn ...any) *Route {
return api.Handle(http.MethodConnect, relativePath, handlersFn...)
}
// Head registers a route for the Head HTTP Method.
//
// Returns a *Route and an error which will be filled if route wasn't registered successfully.
func (api *APIContainer) Head(relativePath string, handlersFn ...interface{}) *Route {
func (api *APIContainer) Head(relativePath string, handlersFn ...any) *Route {
return api.Handle(http.MethodHead, relativePath, handlersFn...)
}
// Options registers a route for the Options HTTP Method.
//
// Returns a *Route and an error which will be filled if route wasn't registered successfully.
func (api *APIContainer) Options(relativePath string, handlersFn ...interface{}) *Route {
func (api *APIContainer) Options(relativePath string, handlersFn ...any) *Route {
return api.Handle(http.MethodOptions, relativePath, handlersFn...)
}
// Patch registers a route for the Patch HTTP Method.
//
// Returns a *Route and an error which will be filled if route wasn't registered successfully.
func (api *APIContainer) Patch(relativePath string, handlersFn ...interface{}) *Route {
func (api *APIContainer) Patch(relativePath string, handlersFn ...any) *Route {
return api.Handle(http.MethodPatch, relativePath, handlersFn...)
}
// Trace registers a route for the Trace HTTP Method.
//
// Returns a *Route and an error which will be filled if route wasn't registered successfully.
func (api *APIContainer) Trace(relativePath string, handlersFn ...interface{}) *Route {
func (api *APIContainer) Trace(relativePath string, handlersFn ...any) *Route {
return api.Handle(http.MethodTrace, relativePath, handlersFn...)
}
@@ -258,7 +258,7 @@ func (api *APIContainer) Trace(relativePath string, handlersFn ...interface{}) *
// Options
// Connect
// Trace
func (api *APIContainer) Any(relativePath string, handlersFn ...interface{}) (routes []*Route) {
func (api *APIContainer) Any(relativePath string, handlersFn ...any) (routes []*Route) {
handlers := api.convertHandlerFuncs(relativePath, handlersFn...)
for _, m := range AllMethods {
@@ -274,7 +274,7 @@ func (api *APIContainer) Any(relativePath string, handlersFn ...interface{}) (ro
// OnErrorCode registers a handlers chain for this `Party` for a specific HTTP status code.
// Read more at: http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
// Look `OnAnyErrorCode` too.
func (api *APIContainer) OnErrorCode(statusCode int, handlersFn ...interface{}) []*Route {
func (api *APIContainer) OnErrorCode(statusCode int, handlersFn ...any) []*Route {
handlers := api.convertHandlerFuncs("/{tail:path}", handlersFn...)
return api.Self.OnErrorCode(statusCode, handlers...)
}
@@ -282,7 +282,7 @@ func (api *APIContainer) OnErrorCode(statusCode int, handlersFn ...interface{})
// OnAnyErrorCode registers a handlers chain for all error codes
// (4xxx and 5xxx, change the `ClientErrorCodes` and `ServerErrorCodes` variables to modify those)
// Look `OnErrorCode` too.
func (api *APIContainer) OnAnyErrorCode(handlersFn ...interface{}) []*Route {
func (api *APIContainer) OnAnyErrorCode(handlersFn ...any) []*Route {
handlers := api.convertHandlerFuncs("/{tail:path}", handlersFn...)
return api.Self.OnAnyErrorCode(handlers...)
}

View File

@@ -1199,7 +1199,7 @@ func (fi *fileInfo) Mode() os.FileMode { return fi.mode }
func (fi *fileInfo) ModTime() time.Time { return fi.modTime }
func (fi *fileInfo) IsDir() bool { return fi.isDir }
func (fi *fileInfo) Size() int64 { return 0 }
func (fi *fileInfo) Sys() interface{} { return fi }
func (fi *fileInfo) Sys() any { return fi }
type dir struct {
os.FileInfo // *fileInfo

View File

@@ -33,7 +33,7 @@ type Party interface {
EnsureStaticBindings() Party
// RegisterDependency calls the `ConfigureContainer.RegisterDependency` method
// with the provided value(s). See `HandleFunc` and `PartyConfigure` methods too.
RegisterDependency(dependencies ...interface{})
RegisterDependency(dependencies ...any)
// HandleFunc registers a route on HTTP verb "method" and relative, to this Party, path.
// It is like the `Handle` method but it accepts one or more "handlersFn" functions
// that each one of them can accept any input arguments as the HTTP request and
@@ -103,13 +103,13 @@ type Party interface {
// the dependency injection, mvc and function handlers.
//
// This method is just a shortcut for the `ConfigureContainer().Handle` one.
HandleFunc(method, relativePath string, handlersFn ...interface{}) *Route
HandleFunc(method, relativePath string, handlersFn ...any) *Route
// UseFunc registers a function which can accept one or more
// dependencies (see RegisterDependency) and returns an iris.Handler
// or a result of <T> and/or an error.
//
// This method is just a shortcut of the `ConfigureContainer().Use`.
UseFunc(handlersFn ...interface{})
UseFunc(handlersFn ...any)
// GetRelPath returns the current party's relative path.
// i.e:
@@ -245,7 +245,7 @@ type Party interface {
// Returns the Party itself for chain calls.
//
// Should be called before children routes regitration.
RemoveHandler(namesOrHandlers ...interface{}) Party
RemoveHandler(namesOrHandlers ...any) Party
// Reset removes all the begin and done handlers that may derived from the parent party via `Use` & `Done`,
// and the execution rules.
// Note that the `Reset` will not reset the handlers that are registered via `UseGlobal` & `DoneGlobal`.
@@ -338,7 +338,7 @@ type Party interface {
//
// Examples:
// https://github.com/kataras/iris/tree/main/_examples/file-server
HandleDir(requestPath string, fileSystem interface{}, opts ...DirOptions) []*Route
HandleDir(requestPath string, fileSystem any, opts ...DirOptions) []*Route
// None registers an "offline" route
// see context.ExecRoute(routeName) and

View File

@@ -335,7 +335,7 @@ func NewRoutePathReverser(apiRoutesProvider RoutesProvider, options ...RoutePath
}
// Path returns a route path based on a route name and any dynamic named parameter's values-only.
func (ps *RoutePathReverser) Path(routeName string, paramValues ...interface{}) string {
func (ps *RoutePathReverser) Path(routeName string, paramValues ...any) string {
r := ps.provider.GetRoute(routeName)
if r == nil {
return ""
@@ -348,7 +348,7 @@ func (ps *RoutePathReverser) Path(routeName string, paramValues ...interface{})
return r.ResolvePath(toStringSlice(paramValues)...)
}
func toStringSlice(args []interface{}) (argsString []string) {
func toStringSlice(args []any) (argsString []string) {
argsSize := len(args)
if argsSize <= 0 {
return
@@ -376,7 +376,7 @@ func toStringSlice(args []interface{}) (argsString []string) {
// developers can just concat the subdomain, (host can be auto-retrieve by browser using the Path).
// URL same as Path but returns the full uri, i.e https://mysubdomain.mydomain.com/hello/iris
func (ps *RoutePathReverser) URL(routeName string, paramValues ...interface{}) (url string) {
func (ps *RoutePathReverser) URL(routeName string, paramValues ...any) (url string) {
if ps.vhost == "" || ps.vscheme == "" {
return "not supported"
}

View File

@@ -154,7 +154,7 @@ func (r *Route) UseOnce(handlers ...context.Handler) {
// Returns the total amount of handlers removed.
//
// Should be called before Application Build.
func (r *Route) RemoveHandler(namesOrHandlers ...interface{}) (count int) {
func (r *Route) RemoveHandler(namesOrHandlers ...any) (count int) {
for _, nameOrHandler := range namesOrHandlers {
handlerName := ""
switch h := nameOrHandler.(type) {
@@ -644,7 +644,7 @@ func (rd routeReadOnlyWrapper) MainHandlerIndex() int {
return rd.Route.MainHandlerIndex
}
func (rd routeReadOnlyWrapper) Property(key string) (interface{}, bool) {
func (rd routeReadOnlyWrapper) Property(key string) (any, bool) {
properties := rd.Route.Party.Properties()
if properties != nil {
if property, ok := properties[key]; ok {