fixed golint/go vet
Change-Id: Id8aa01511f459d45f9dc3270e1d13b8682944016
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// HTTP implements error and keeps track of http return codes.
|
||||
type HTTP struct {
|
||||
error
|
||||
Message string
|
||||
@@ -15,6 +16,7 @@ func (e HTTP) Error() string {
|
||||
return fmt.Sprintf("%d: %s", e.Code, e.Message)
|
||||
}
|
||||
|
||||
// ToHTTP wraps the type assertion to change an error into an HTTP.
|
||||
func ToHTTP(err error) *HTTP {
|
||||
if err == nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user