Skip to content

Commit 82917fd

Browse files
KimMachineGunvishr
authored andcommitted
Delete useless goto statements (#1208)
1 parent c8fd197 commit 82917fd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

router.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ func (r *Router) Find(method, path string, c Context) {
313313
// Search order static > param > any
314314
for {
315315
if search == "" {
316-
goto End
316+
break
317317
}
318318

319319
pl := 0 // Prefix length
@@ -348,7 +348,7 @@ func (r *Router) Find(method, path string, c Context) {
348348
}
349349

350350
if search == "" {
351-
goto End
351+
break
352352
}
353353

354354
// Static node
@@ -405,10 +405,9 @@ func (r *Router) Find(method, path string, c Context) {
405405
return
406406
}
407407
pvalues[len(cn.pnames)-1] = search
408-
goto End
408+
break
409409
}
410410

411-
End:
412411
ctx.handler = cn.findHandler(method)
413412
ctx.path = cn.ppath
414413
ctx.pnames = cn.pnames

0 commit comments

Comments
 (0)