Drops LINK and UNLINK shortcuts

This commit is contained in:
Manu Mtz-Almeida 2015-05-20 00:32:06 +02:00
parent 022304e7d9
commit e59475c615
2 changed files with 1 additions and 23 deletions

View File

@ -88,18 +88,8 @@ func (group *RouterGroup) HEAD(relativePath string, handlers ...HandlerFunc) {
group.handle("HEAD", relativePath, handlers)
}
// LINK is a shortcut for router.Handle("LINK", path, handle)
func (group *RouterGroup) LINK(relativePath string, handlers ...HandlerFunc) {
group.handle("LINK", relativePath, handlers)
}
// UNLINK is a shortcut for router.Handle("UNLINK", path, handle)
func (group *RouterGroup) UNLINK(relativePath string, handlers ...HandlerFunc) {
group.handle("UNLINK", relativePath, handlers)
}
func (group *RouterGroup) Any(relativePath string, handlers ...HandlerFunc) {
// GET, POST, PUT, PATCH, HEAD, OPTIONS, DELETE, CONNECT, WS, LINK, UNLINK, TRACE
// GET, POST, PUT, PATCH, HEAD, OPTIONS, DELETE, CONNECT, TRACE
group.handle("GET", relativePath, handlers)
group.handle("POST", relativePath, handlers)
group.handle("PUT", relativePath, handlers)
@ -108,9 +98,6 @@ func (group *RouterGroup) Any(relativePath string, handlers ...HandlerFunc) {
group.handle("OPTIONS", relativePath, handlers)
group.handle("DELETE", relativePath, handlers)
group.handle("CONNECT", relativePath, handlers)
group.handle("WS", relativePath, handlers)
group.handle("LINK", relativePath, handlers)
group.handle("UNLINK", relativePath, handlers)
group.handle("TRACE", relativePath, handlers)
}

View File

@ -39,9 +39,6 @@ func TestRouterGroupBasicHandle(t *testing.T) {
performRequestInGroup(t, "DELETE")
performRequestInGroup(t, "HEAD")
performRequestInGroup(t, "OPTIONS")
performRequestInGroup(t, "LINK")
performRequestInGroup(t, "UNLINK")
}
func performRequestInGroup(t *testing.T, method string) {
@ -78,12 +75,6 @@ func performRequestInGroup(t *testing.T, method string) {
case "OPTIONS":
v1.OPTIONS("/test", handler)
login.OPTIONS("/test", handler)
case "LINK":
v1.LINK("/test", handler)
login.LINK("/test", handler)
case "UNLINK":
v1.UNLINK("/test", handler)
login.UNLINK("/test", handler)
default:
panic("unknown method")
}