mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-23 16:58:31 +02:00
refactor: modernize code with go fix
This commit is contained in:
@@ -162,10 +162,9 @@ func (ep *Entrypoint) SetAccessLogger(parent task.Parent, cfg *accesslog.Request
|
||||
}
|
||||
|
||||
func findRouteAnyDomain(routes HTTPRoutes, host string) types.HTTPRoute {
|
||||
//nolint:modernize
|
||||
idx := strings.IndexByte(host, '.')
|
||||
if idx != -1 {
|
||||
target := host[:idx]
|
||||
before, _, ok := strings.Cut(host, ".")
|
||||
if ok {
|
||||
target := before
|
||||
if r, ok := routes.Get(target); ok {
|
||||
return r
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user