golang如何判断操作系统类型?

KunGo · 2014-02-18 08:54:20 · 18477 次点击

switch runtime.GOOS { case "darwin": case "windows": case "linux": }

go tool dist list -json 查找系统

#3
更多评论
polaris
社区,需要你我一同完善!

runtime.GOARCH 返回当前的系统架构;runtime.GOOS 返回当前的操作系统。

#1