개요
- Go OS 확인
- Golang OS 확인
package main
import (
"fmt"
"runtime"
)
func main() {
os := runtime.GOOS
switch os {
case "windows":
fmt.Println("Windows")
case "darwin":
fmt.Println("MacOS")
case "linux":
fmt.Println("Linux")
default:
fmt.Printf("%s.\n", os)
}
}