Gin: There is no way to remove the route?

Created on 8 Oct 2017  路  5Comments  路  Source: gin-gonic/gin

There is no way to remove the route?

Most helpful comment

We can't understand your problem this way

  • Format your code with the Go code tag
  • Present the issue in a better way
  • Use English comments

All 5 comments

func (engine *Engine) RemoveRoute(path string) bool {
for _, tree := range engine.trees {
find("", path, tree.root, tree.root)
}
return true
}

func find(path, targetRoute string, root *node, org *node) {
path += root.path
if len(root.handlers) > 0 && strings.EqualFold(path, targetRoute) {
//娓呯悊 handlers chain
var hd HandlersChain
root.handlers = hd
return
}
for _, child := range root.children {
find(path, targetRoute, child, root)
}
}

@monikaYZ I thank U delete uro route in net.http.Server handler struct.

We can't understand your problem this way

  • Format your code with the Go code tag
  • Present the issue in a better way
  • Use English comments

please post more details and closing, if you still problem please reopen and discuss. thanks! duplicated #776

I also need a dynamic route. Please support deleting or canceling routing!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ccaza picture ccaza  路  3Comments

Bloomca picture Bloomca  路  3Comments

frederikhors picture frederikhors  路  3Comments

cxk280 picture cxk280  路  3Comments

rawoke083 picture rawoke083  路  3Comments