From e59475c6158991aa8c1965b5ee9f75957a0a0f1f Mon Sep 17 00:00:00 2001 From: Manu Mtz-Almeida Date: Wed, 20 May 2015 00:32:06 +0200 Subject: [PATCH] Drops LINK and UNLINK shortcuts --- routergroup.go | 15 +-------------- routergroup_test.go | 9 --------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/routergroup.go b/routergroup.go index 7669aec2..d40cdcec 100644 --- a/routergroup.go +++ b/routergroup.go @@ -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) } diff --git a/routergroup_test.go b/routergroup_test.go index 24a28c14..6500b22f 100644 --- a/routergroup_test.go +++ b/routergroup_test.go @@ -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") }