Implement port testing. Fixes #11

This commit is contained in:
Martin Polden
2016-04-15 20:52:15 +02:00
parent 6e09b06e7d
commit 4edbd3cf10
5 changed files with 79 additions and 0 deletions

View File

@ -21,6 +21,10 @@ func notFound(err error) *appError {
return &appError{Error: err, Code: http.StatusNotFound}
}
func badRequest(err error) *appError {
return &appError{Error: err, Code: http.StatusBadRequest}
}
func (e *appError) AsJSON() *appError {
e.ContentType = APPLICATION_JSON
return e