Go Browser Package
browser.dineshgowda.com
browser.dineshgowda.com
I would prefer user-agent which is a well understood term.
It also misses some really common user agents, basically all iOS 11 and 12. They may be rare nowadays, but they still occur.
If I had any nit to make, it's about browser.NewBrowser. It stutters, and even with just New(), at first I thought it was making a client. Not sure what I'd go with, maybe Parse like net/url?
Again, just a minor nit, not trying to take away what you've done here at all.
The correct name would be "useragent".
the user-agent string has an essentially arbitrary format, so its not really a good place to be reading data from, or worse serving a different response based on the value.
If you have a website, you want to collect statistical data on which browsers are accessing your website and test for the best experiences on the top browsers.
what REALLY happens is the most popular browser and even version is determined, and anything thats not that doesn't get tested, and eventually breaks. its the pinnacle of lazy programming. "lets use telemetry so that we can point to data that allows us to make software thats as brittle as possible".
Citation needed
They won’t.
But also, what exactly were you expecting out of a citation? A survey done about whether people spoof their UA or not? That doesn’t exist and likely never will.
Agreed. Feature detection is the way, not UA sniffing.