fix some types on errors and form

Signed-off-by: kaiwentan <kaiwentan@harmonycloud.cn>
This commit is contained in:
kaiwentan 2017-02-07 20:29:32 +08:00
parent 09e99ef1fc
commit ac9c47e26f
3 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@ func (e apiError) HTTPErrorStatusCode() int {
// NewErrorWithStatusCode allows you to associate
// a specific HTTP Status Code to an error.
// The Server will take that code and set
// The server will take that code and set
// it as the response status.
func NewErrorWithStatusCode(err error, code int) error {
return apiError{err, code}

View File

@ -28,7 +28,7 @@ type inputValidationError interface {
IsValidationError() bool
}
// GetHTTPErrorStatusCode retrieves status code from error message
// GetHTTPErrorStatusCode retrieves status code from error message.
func GetHTTPErrorStatusCode(err error) int {
if err == nil {
logrus.WithFields(logrus.Fields{"error": err}).Error("unexpected HTTP error handling")

View File

@ -15,7 +15,7 @@ func BoolValue(r *http.Request, k string) bool {
}
// BoolValueOrDefault returns the default bool passed if the query param is
// missing, otherwise it's just a proxy to boolValue above
// missing, otherwise it's just a proxy to boolValue above.
func BoolValueOrDefault(r *http.Request, k string, d bool) bool {
if _, ok := r.Form[k]; !ok {
return d