Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "runtime"
- )
- func main() {
- fmt.Print("Go runs on ")
- os := runtime.GOOS
- switch os {
- case "windows":
- fmt.Println("Windows")
- case "darwin":
- fmt.Println("Mac")
- case "linux":
- fmt.Println("GNU/Linux")
- default:
- // freebsd, openbsd, plan9...
- fmt.Printf("%s.", os)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement