summaryrefslogtreecommitdiff
path: root/href.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-03-21 22:00:46 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-03-21 22:00:46 +0100
commit06d7409a46f77692a2f5c4e135ec5ba2d24d019c (patch)
treee76c6ccfa525924fd9f67488018be36f0884a340 /href.go
parent460bac780774bb582153313d06f67f331d18506f (diff)
Make lint a little bit happier
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)