summaryrefslogtreecommitdiffstats
path: root/Godeps/_workspace/src/github.com/mssola
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-11-23 15:53:48 -0800
committer=Corey Hulen <corey@hulen.com>2015-11-23 15:53:48 -0800
commit4f4cd5e63573da4d6edcc7d4213afaca67c19f88 (patch)
treecefbc7af53629d97644ca2f6b2369e9d879f0101 /Godeps/_workspace/src/github.com/mssola
parentf8a3c9a14edca6df0647d89cf225f2470cbe025c (diff)
downloadchat-4f4cd5e63573da4d6edcc7d4213afaca67c19f88.tar.gz
chat-4f4cd5e63573da4d6edcc7d4213afaca67c19f88.tar.bz2
chat-4f4cd5e63573da4d6edcc7d4213afaca67c19f88.zip
upgrading libs
Diffstat (limited to 'Godeps/_workspace/src/github.com/mssola')
-rw-r--r--Godeps/_workspace/src/github.com/mssola/user_agent/bot.go5
-rw-r--r--Godeps/_workspace/src/github.com/mssola/user_agent/browser.go5
2 files changed, 6 insertions, 4 deletions
diff --git a/Godeps/_workspace/src/github.com/mssola/user_agent/bot.go b/Godeps/_workspace/src/github.com/mssola/user_agent/bot.go
index cc993d8fe..df0b6ccda 100644
--- a/Godeps/_workspace/src/github.com/mssola/user_agent/bot.go
+++ b/Godeps/_workspace/src/github.com/mssola/user_agent/bot.go
@@ -9,6 +9,8 @@ import (
"strings"
)
+var botFromSiteRegexp = regexp.MustCompile("http://.+\\.\\w+")
+
// Get the name of the bot from the website that may be in the given comment. If
// there is no website in the comment, then an empty string is returned.
func getFromSite(comment []string) string {
@@ -23,8 +25,7 @@ func getFromSite(comment []string) string {
}
// Pick the site.
- re := regexp.MustCompile("http://.+\\.\\w+")
- results := re.FindStringSubmatch(comment[idx])
+ results := botFromSiteRegexp.FindStringSubmatch(comment[idx])
if len(results) == 1 {
// If it's a simple comment, just return the name of the site.
if idx == 0 {
diff --git a/Godeps/_workspace/src/github.com/mssola/user_agent/browser.go b/Godeps/_workspace/src/github.com/mssola/user_agent/browser.go
index c5612db7b..a45c8ab7f 100644
--- a/Godeps/_workspace/src/github.com/mssola/user_agent/browser.go
+++ b/Godeps/_workspace/src/github.com/mssola/user_agent/browser.go
@@ -9,6 +9,8 @@ import (
"strings"
)
+var ie11Regexp = regexp.MustCompile("^rv:(.+)$")
+
// A struct containing all the information that we might be
// interested from the browser.
type Browser struct {
@@ -75,9 +77,8 @@ func (p *UserAgent) detectBrowser(sections []section) {
// This is the new user agent from Internet Explorer 11.
p.browser.Engine = "Trident"
p.browser.Name = "Internet Explorer"
- reg, _ := regexp.Compile("^rv:(.+)$")
for _, c := range sections[0].comment {
- version := reg.FindStringSubmatch(c)
+ version := ie11Regexp.FindStringSubmatch(c)
if len(version) > 0 {
p.browser.Version = version[1]
return