Permalink
Browse files

Rename UserAgent which is now a method.

  • Loading branch information...
1 parent 796260f commit acc9c3930647cc2ecc403c1c8df12f2eaf865a6e @warp warp committed Jun 23, 2011
Showing with 6 additions and 6 deletions.
  1. +6 −6 browser.go
View
12 browser.go
@@ -21,25 +21,25 @@ func hasAnySubstring(agent string, substrings []string) bool {
}
func IsMobile(r *http.Request) bool {
- is := hasAnySubstring(r.UserAgent, mobileAgentSubstrings)
+ is := hasAnySubstring(r.UserAgent(), mobileAgentSubstrings)
if is {
- fmt.Println("Mobile browser detected! User-Agent:", r.UserAgent)
+ fmt.Println("Mobile browser detected! User-Agent:", r.UserAgent())
}
return is
}
func IsIE(r *http.Request) bool {
- is := hasAnySubstring(r.UserAgent, ieAgentSubstrings)
+ is := hasAnySubstring(r.UserAgent(), ieAgentSubstrings)
if is {
- fmt.Println("IE detected! User-Agent:", r.UserAgent)
+ fmt.Println("IE detected! User-Agent:", r.UserAgent())
}
return is
}
func IsFirefox(r *http.Request) bool {
- is := hasAnySubstring(r.UserAgent, firefoxAgentSubstrings)
+ is := hasAnySubstring(r.UserAgent(), firefoxAgentSubstrings)
if is {
- fmt.Println("Firefox detected! User-Agent:", r.UserAgent)
+ fmt.Println("Firefox detected! User-Agent:", r.UserAgent())
}
return is
}

0 comments on commit acc9c39

Please sign in to comment.