Return NewError function where it belongs
This commit is contained in:
@@ -19,6 +19,10 @@ type Error struct {
|
|||||||
Message string `json:"error"`
|
Message string `json:"error"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewError(err error) Error {
|
||||||
|
return Error{err.Error()}
|
||||||
|
}
|
||||||
|
|
||||||
func assetContentType(name string) string {
|
func assetContentType(name string) string {
|
||||||
mime := MIME_TYPES[filepath.Ext(name)]
|
mime := MIME_TYPES[filepath.Ext(name)]
|
||||||
|
|
||||||
|
|||||||
@@ -19,10 +19,6 @@ type Result struct {
|
|||||||
Rows [][]interface{} `json:"rows"`
|
Rows [][]interface{} `json:"rows"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewError(err error) Error {
|
|
||||||
return Error{err.Error()}
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewClient() (*Client, error) {
|
func NewClient() (*Client, error) {
|
||||||
db, err := sqlx.Open("postgres", getConnectionString())
|
db, err := sqlx.Open("postgres", getConnectionString())
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user