(userAgent string)
| 18 | } |
| 19 | |
| 20 | func IsAgentFromUserAgent(userAgent string) bool { |
| 21 | for _, agent := range AllAgents { |
| 22 | if len(agent.Keywords) > 0 { |
| 23 | for _, keyword := range agent.Keywords { |
| 24 | if strings.Contains(userAgent, keyword) { |
| 25 | return true |
| 26 | } |
| 27 | } |
| 28 | } |
| 29 | } |
| 30 | return false |
| 31 | } |