Return NewError function where it belongs

This commit is contained in:
Dan Sosedoff 2014-11-20 21:43:51 -06:00
parent 82307cde6c
commit 27104c05f1
2 changed files with 4 additions and 4 deletions

4
api.go
View File

@ -19,6 +19,10 @@ type Error struct {
Message string `json:"error"`
}
func NewError(err error) Error {
return Error{err.Error()}
}
func assetContentType(name string) string {
mime := MIME_TYPES[filepath.Ext(name)]

View File

@ -19,10 +19,6 @@ type Result struct {
Rows [][]interface{} `json:"rows"`
}
func NewError(err error) Error {
return Error{err.Error()}
}
func NewClient() (*Client, error) {
db, err := sqlx.Open("postgres", getConnectionString())