package main
import (
"fmt"
"runtime"
)
func main() {
fmt.Print("Go runs on ")
// this is a switch statement.
// unlike other languages, Go does not
// automatically "fall through" to other
// 'case' or 'default' statements unless
// this is explicitly made to happen
switch os := runtime.GOOS; os {
case "darwin":
fmt.Println("macOS.")
case "linux":
fmt.Println("Linux.")
default:
fmt.Printf("%s.", os)
}
}
To embed this program on your website, copy the following code and paste it into your website's HTML: