diff options
Diffstat (limited to 'gemini/response.go')
-rw-r--r-- | gemini/response.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gemini/response.go b/gemini/response.go index ec4ac2b..940dc35 100644 --- a/gemini/response.go +++ b/gemini/response.go @@ -293,11 +293,11 @@ func StatusName(status types.Status) string { } } -// InvalidResponseLineEnding indicates that a gemini response header didn't end with "\r\n". -var InvalidResponseLineEnding = errors.New("Invalid response line ending.") +// ErrInvalidResponseLineEnding indicates that a gemini response header didn't end with "\r\n". +var ErrInvalidResponseLineEnding = errors.New("invalid response line ending") -// InvalidResponseHeaderLine indicates a malformed gemini response header line. -var InvalidResponseHeaderLine = errors.New("Invalid response header line.") +// ErrInvalidResponseHeaderLine indicates a malformed gemini response header line. +var ErrInvalidResponseHeaderLine = errors.New("invalid response header line") // ParseResponse parses a complete gemini response from a reader. // @@ -307,19 +307,19 @@ func ParseResponse(rdr io.Reader) (*types.Response, error) { hdrLine, err := bufrdr.ReadBytes('\n') if err != nil { - return nil, InvalidResponseLineEnding + return nil, ErrInvalidResponseLineEnding } if hdrLine[len(hdrLine)-2] != '\r' { - return nil, InvalidResponseLineEnding + return nil, ErrInvalidResponseLineEnding } if hdrLine[2] != ' ' { - return nil, InvalidResponseHeaderLine + return nil, ErrInvalidResponseHeaderLine } hdrLine = hdrLine[:len(hdrLine)-2] status, err := strconv.Atoi(string(hdrLine[:2])) if err != nil { - return nil, InvalidResponseHeaderLine + return nil, ErrInvalidResponseHeaderLine } return &types.Response{ |