organize better in sub packages

This commit is contained in:
Henrique Dias
2016-10-18 21:30:10 +01:00
parent 06c1a412a6
commit f2fbe92591
10 changed files with 47 additions and 35 deletions

View File

@@ -1,20 +0,0 @@
package errors
import (
"net/http"
"os"
)
// ToHTTPCode gets the respective HTTP code for an error
func ToHTTPCode(err error) int {
switch {
case os.IsPermission(err):
return http.StatusForbidden
case os.IsNotExist(err):
return http.StatusNotFound
case os.IsExist(err):
return http.StatusGone
default:
return http.StatusInternalServerError
}
}