You can get the system type in Go by using the runtime.GOOS variable.
Here's an example code snippet:
main.go117 chars11 linesThe above code will print the name of the operating system on which the program is running. This value will be one of the following:
Note that runtime.GOOS returns the operating system's official name, which may not always be the same as the user-friendly name.
gistlibby LogSnag