18 lines
262 B
Go
18 lines
262 B
Go
package learning
|
|
|
|
import (
|
|
"fmt"
|
|
"runtime"
|
|
)
|
|
|
|
func SwitchCase() {
|
|
fmt.Println("Go runs on: ")
|
|
switch os := runtime.GOOS; os {
|
|
case "darwin":
|
|
fmt.Println("OS X")
|
|
case "linux":
|
|
fmt.Println("Linux")
|
|
default:
|
|
fmt.Printf("%s. \n", os)
|
|
}
|
|
}
|