1 개요[ | ]
- Go OS 확인
- Golang OS 확인
Go
CPU
-1.0s
MEM
-0M
-1.0s
Copy
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)
}
}
Linux
2 같이 보기[ | ]
3 참고[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.