aboutsummaryrefslogtreecommitdiffstats
path: root/lib/parse/hyperlinks.go
diff options
context:
space:
mode:
authorMoritz Poldrack <git@moritz.sh>2022-07-31 22:16:40 +0200
committerRobin Jarry <robin@jarry.cc>2022-08-01 10:44:52 +0200
commitaaf0a0c65673db4b94c0dc200d7394a192128da1 (patch)
tree44940936efff55b49a6d359d053f55c7ab824e4d /lib/parse/hyperlinks.go
parent21dcd440f877192af128c00ca2acbabf68bb3ee3 (diff)
downloadaerc-aaf0a0c65673db4b94c0dc200d7394a192128da1.tar.gz
lint: apply new formatting rules
Run `make fmt`. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib/parse/hyperlinks.go')
-rw-r--r--lib/parse/hyperlinks.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/parse/hyperlinks.go b/lib/parse/hyperlinks.go
index 7a005383..2087a55c 100644
--- a/lib/parse/hyperlinks.go
+++ b/lib/parse/hyperlinks.go
@@ -8,8 +8,10 @@ import (
"strings"
)
-var submatch = `(https?:\/\/[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,10}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*))`
-var httpRe = regexp.MustCompile("\"" + submatch + "\"" + "|" + "\\(" + submatch + "\\)" + "|" + "<" + submatch + ">" + "|" + submatch)
+var (
+ submatch = `(https?:\/\/[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,10}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*))`
+ httpRe = regexp.MustCompile("\"" + submatch + "\"" + "|" + "\\(" + submatch + "\\)" + "|" + "<" + submatch + ">" + "|" + submatch)
+)
// HttpLinks searches a reader for a http link and returns a copy of the
// reader and a slice with links.
@@ -36,7 +38,7 @@ func HttpLinks(r io.Reader) (io.Reader, []string) {
}
results := []string{}
- for link, _ := range linkMap {
+ for link := range linkMap {
results = append(results, link)
}