From da9d8e922d0198a324af1f1b6df97d3e1d5938aa Mon Sep 17 00:00:00 2001 From: Karan Misra Date: Mon, 27 Jan 2014 10:54:05 +0530 Subject: remove the need to provide “missing/unsupported” implementations in the API consumers. also: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - more idiomatic - loosely coupled with the API contract --- tests/items.go | 8 ++------ tests/test.go | 6 ++---- 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'tests') diff --git a/tests/items.go b/tests/items.go index d39cae9..6aae382 100644 --- a/tests/items.go +++ b/tests/items.go @@ -2,13 +2,11 @@ package main import ( "net/url" - "sleepy" + + "github.com/kid0m4n/sleepy" ) type Item struct { - sleepy.PostNotSupported - sleepy.PutNotSupported - sleepy.DeleteNotSupported } func (item Item) Get(values url.Values) (int, interface{}) { @@ -19,11 +17,9 @@ func (item Item) Get(values url.Values) (int, interface{}) { } func main() { - item := new(Item) var api = new(sleepy.Api) api.AddResource(item, "/items") api.Start(3000) - } diff --git a/tests/test.go b/tests/test.go index 070d4b6..8ccbfbd 100644 --- a/tests/test.go +++ b/tests/test.go @@ -2,13 +2,11 @@ package main import ( "net/url" - "sleepy" + + "github.com/dougblack/sleepy" ) type Bar struct { - sleepy.PostNotSupported - sleepy.PutNotSupported - sleepy.DeleteNotSupported } func (b Bar) Get(values url.Values) (int, interface{}) { -- cgit