func (p *UserAgent) initialize() {
	p.ua = ""
	p.mozilla = ""
	p.platform = ""
	p.os = ""
	p.localization = ""
	p.browser.Engine = ""
	p.browser.EngineVersion = ""
	p.browser.Name = ""
	p.browser.Version = ""
	p.bot = false
	p.mobile = false
	p.undecided = false
}
Initialize the parser.
package user_agent
import "strings"
type section struct {
	name    string
	version string
	comment []string
}
type UserAgent struct {
	ua           string
	mozilla      string
	platform     string
	os           string
	localization string
	browser      Browser
	bot          bool
	mobile       bool
	undecided    bool
}
func readUntil(ua string, index *int, delimiter byte, cat bool) []byte {
	var buffer []byte
	i := *index
	catalan := 0
	for ; i < len(ua); i = i + 1 {
		if ua[i] == delimiter {
			if catalan == 0 {
				*index = i + 1
				return buffer
			}
			catalan--
		} else if cat && ua[i] == '(' {
			catalan++
		}
		buffer = append(buffer, ua[i])
	}
	*index = i + 1
	return buffer
}
func parseProduct(product []byte) (string, string) {
	prod := strings.SplitN(string(product), "/", 2)
	if len(prod) == 2 {
		return prod[0], prod[1]
	}
	return string(product), ""
}
func parseSection(ua string, index *int) (s section) {
	var buffer []byte
	if *index < len(ua) && ua[*index] != '(' && ua[*index] != '[' {
		buffer = readUntil(ua, index, ' ', false)
		s.name, s.version = parseProduct(buffer)
	}
	if *index < len(ua) && ua[*index] == '(' {
		*index++
		buffer = readUntil(ua, index, ')', true)
		s.comment = strings.Split(string(buffer), "; ")
		*index++
	}
	if *index < len(ua) && ua[*index] == '[' {
		*index++
		buffer = readUntil(ua, index, ']', true)
		*index++
	}
	return s
}