Skip to content

Commit 96be504

Browse files
authored
Merge pull request #2958 from tisonkun/fix-typos
chore: fix typos in httperror.go
2 parents d1d8ad3 + b12f646 commit 96be504

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

httperror.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"net/http"
1010
)
1111

12-
// Following errors can produce HTTP status code by implementing HTTPStatusCoder interface
12+
// The following errors can produce HTTP status code by implementing HTTPStatusCoder interface
1313
var (
1414
ErrBadRequest = &httpError{http.StatusBadRequest} // 400
1515
ErrUnauthorized = &httpError{http.StatusUnauthorized} // 401
@@ -25,7 +25,7 @@ var (
2525
ErrServiceUnavailable = &httpError{http.StatusServiceUnavailable} // 503
2626
)
2727

28-
// Following errors fall into 500 (InternalServerError) category
28+
// The following errors fall into 500 (InternalServerError) category
2929
var (
3030
ErrValidatorNotRegistered = errors.New("validator not registered")
3131
ErrRendererNotRegistered = errors.New("renderer not registered")
@@ -35,13 +35,13 @@ var (
3535
ErrInvalidListenerNetwork = errors.New("invalid listener network")
3636
)
3737

38-
// HTTPStatusCoder is interface that errors can implement to produce status code for HTTP response
38+
// HTTPStatusCoder is an interface that errors can implement to produce status code for HTTP response
3939
type HTTPStatusCoder interface {
4040
StatusCode() int
4141
}
4242

43-
// StatusCode returns status code from error if it implements HTTPStatusCoder interface.
44-
// If error does not implement the interface it returns 0.
43+
// StatusCode returns status code from err if it implements HTTPStatusCoder interface.
44+
// If err does not implement the interface, it returns 0.
4545
func StatusCode(err error) int {
4646
var sc HTTPStatusCoder
4747
if errors.As(err, &sc) {
@@ -95,7 +95,7 @@ func ResolveResponseStatus(rw http.ResponseWriter, err error) (resp *Response, s
9595
return resp, status
9696
}
9797

98-
// NewHTTPError creates new instance of HTTPError
98+
// NewHTTPError creates a new instance of HTTPError
9999
func NewHTTPError(code int, message string) *HTTPError {
100100
return &HTTPError{
101101
Code: code,
@@ -116,7 +116,7 @@ func (he *HTTPError) StatusCode() int {
116116
return he.Code
117117
}
118118

119-
// Error makes it compatible with `error` interface.
119+
// Error makes it compatible with the ` error ` interface.
120120
func (he *HTTPError) Error() string {
121121
msg := he.Message
122122
if msg == "" {
@@ -128,7 +128,7 @@ func (he *HTTPError) Error() string {
128128
return fmt.Sprintf("code=%d, message=%v, err=%v", he.Code, msg, he.err.Error())
129129
}
130130

131-
// Wrap eturns new HTTPError with given errors wrapped inside
131+
// Wrap returns a new HTTPError with given errors wrapped inside
132132
func (he HTTPError) Wrap(err error) error {
133133
return &HTTPError{
134134
Code: he.Code,

0 commit comments

Comments
 (0)