summaryrefslogtreecommitdiff
path: root/href.go
diff options
context:
space:
mode:
Diffstat (limited to 'href.go')
-rw-r--r--href.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/href.go b/href.go
index 49b613c..d06d04c 100644
--- a/href.go
+++ b/href.go
@@ -14,9 +14,9 @@ import (
)
var (
- notHTML = errors.New("not HTML content")
- tooBig = errors.New("content too big")
- iconvErr = errors.New("charset converter error")
+ errNotHTML = errors.New("not HTML content")
+ errTooBig = errors.New("content too big")
+ errIconv = errors.New("charset converter error")
)
const (
@@ -60,16 +60,16 @@ func FetchTitle(uri string) (string, error) {
ct := resp.Header.Get("Content-Type")
if !strings.HasPrefix(ct, "text/html") {
- return "", notHTML
+ return "", errNotHTML
}
if resp.ContentLength > 8*MB {
- return "", tooBig
+ return "", errTooBig
}
r, err := charset.NewReader(resp.Body, ct)
if err != nil {
- return "", iconvErr
+ return "", errIconv
}
doc, err := html.Parse(r)