Browse code

fix some types on errors and form

Signed-off-by: kaiwentan <kaiwentan@harmonycloud.cn>

kaiwentan authored on 2017/02/07 21:29:32
Showing 3 changed files
... ...
@@ -16,7 +16,7 @@ func (e apiError) HTTPErrorStatusCode() int {
16 16
 
17 17
 // NewErrorWithStatusCode allows you to associate
18 18
 // a specific HTTP Status Code to an error.
19
-// The Server will take that code and set
19
+// The server will take that code and set
20 20
 // it as the response status.
21 21
 func NewErrorWithStatusCode(err error, code int) error {
22 22
 	return apiError{err, code}
... ...
@@ -28,7 +28,7 @@ type inputValidationError interface {
28 28
 	IsValidationError() bool
29 29
 }
30 30
 
31
-// GetHTTPErrorStatusCode retrieves status code from error message
31
+// GetHTTPErrorStatusCode retrieves status code from error message.
32 32
 func GetHTTPErrorStatusCode(err error) int {
33 33
 	if err == nil {
34 34
 		logrus.WithFields(logrus.Fields{"error": err}).Error("unexpected HTTP error handling")
... ...
@@ -15,7 +15,7 @@ func BoolValue(r *http.Request, k string) bool {
15 15
 }
16 16
 
17 17
 // BoolValueOrDefault returns the default bool passed if the query param is
18
-// missing, otherwise it's just a proxy to boolValue above
18
+// missing, otherwise it's just a proxy to boolValue above.
19 19
 func BoolValueOrDefault(r *http.Request, k string, d bool) bool {
20 20
 	if _, ok := r.Form[k]; !ok {
21 21
 		return d