mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-20 16:01:36 +02:00
refactor(query): replace anonymous functions with sequence and for loop
This commit is contained in:
@@ -137,9 +137,11 @@ func (p *Provider) Start(parent task.Parent) gperr.Error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *Provider) RangeRoutes(do func(string, *route.Route)) {
|
||||
func (p *Provider) IterRoutes(yield func(string, *route.Route) bool) {
|
||||
for alias, r := range p.routes {
|
||||
do(alias, r)
|
||||
if !yield(alias, r) {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user