I am currently writing a REST API client, and I am trying to determine which OS the user is using to create a useful User Agent string. This will allow me (I hope) to make the right decisions about which OS I will have to support in the future.
What I would like to do is: create a line that looks something like this:
Linux / 1.3.2 OR Darwin / 1.3.2 OR Windows / 1.3.2
It should work through Linux / Mac / Windows.
I can currently get the type of OS (ex: 'linux' / 'windows' / 'darwin') using
runtime.GOOS
But I can not find a way to capture the main / minor / micro OS versions.
source
share