Skip to content

Instantly share code, notes, and snippets.

@egroj97
Created June 2, 2018 01:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save egroj97/1e2387e49a5b428b4f0248f27ffd352f to your computer and use it in GitHub Desktop.
Save egroj97/1e2387e49a5b428b4f0248f27ffd352f to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"runtime"
)
func main() {
fmt.Print("Go runs on ")
switch os := runtime.GOOS; os {
case "darwin":
fmt.Println("OS X.")
case "linux":
fmt.Println("Linux.")
default:
// freebsd, openbsd,
// plan9, windows...
fmt.Printf("%s.", os)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment