Package whatos provides the splendid function TellMe()
, which returns the string value: "macOS", "linux", or "other" depending on which operating system it is run on.
package main
import "github.com/ogryzek/whatos"
func main() {
myOs := whatos.TellMe()
fmt.Println(myOs)
}