Skip to content

Commit

Permalink
Update go_http_api.md
Browse files Browse the repository at this point in the history
  • Loading branch information
geraldb committed Nov 20, 2014
1 parent b882d33 commit 15ad039
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions go_http_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 15ad039

Please sign in to comment.