Skip to content

Latest commit

 

History

History
executable file
·
23 lines (15 loc) · 469 Bytes

README.md

File metadata and controls

executable file
·
23 lines (15 loc) · 469 Bytes

uaparser

GoDoc

Example usage

package main

import (
  "fmt"
  "github.com/atomx/uaparser"
)

func main() {
  id, version := uaparser.Browser("Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:40.0) Gecko/20100101 Firefox/40.0")

  major, minor := uaparser.Unversion(version)

  fmt.Printf("%s %d.%d", uaparser.Browsers[id], major, minor)
}