16 lines
206 B
Go
16 lines
206 B
Go
|
package util
|
||
|
|
||
|
import (
|
||
|
"runtime"
|
||
|
)
|
||
|
|
||
|
type myos struct{}
|
||
|
|
||
|
// 操作系统工具.
|
||
|
var OS = myos{}
|
||
|
|
||
|
// 判断是否是 Windows 操作系统.
|
||
|
func (*myos) IsWindows() bool {
|
||
|
return "windows" == runtime.GOOS
|
||
|
}
|