From 15ad039e58e97738d29acfb6426b3a3f29a3dcfa Mon Sep 17 00:00:00 2001 From: Gerald Bauer Date: Thu, 20 Nov 2014 16:04:36 +0100 Subject: [PATCH] Update go_http_api.md --- go_http_api.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/go_http_api.md b/go_http_api.md index 260ce86..1215b60 100644 --- a/go_http_api.md +++ b/go_http_api.md @@ -113,7 +113,7 @@ Use `go get github.com/mattn/go-sqlite3` to install. ~~~ func FetchEvents() []Event { - db = sql.Open( "sqlite3", "./football.db" ) + db, err := sql.Open( "sqlite3", "./football.db" ) if err != nil { log.Fatal(err) } @@ -154,10 +154,9 @@ import ( ~~~ ~~~ -func GetEvents() (interface{},error) { +func GetEvents() (interface{}, error) { // step 1: fetch records events := FetchEvents() - log.Println( events ) // step 2: map to json structs for serialization/marshalling type JsEvent struct {