More faster than other implementations.
p, err := uaparser.NewParser("/path/to/regexes.yaml")
if err != nil {
log.Println(err.Error())
return
}
agent, found := p.Parse("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.59 Safari/537.36")
if found {
log.Printf("%#v,\n %#v, \n %#v", agent.Browser, agent.OS, agent.Device)
}
UserAgent
data comes from:https://github.com/ua-parser/uap-core- Specification