You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
453 B
31 lines
453 B
package commons
|
|
|
|
import (
|
|
"runtime"
|
|
"strconv"
|
|
"time"
|
|
)
|
|
|
|
func IsWindows() bool {
|
|
return runtime.GOOS == "windows"
|
|
}
|
|
|
|
func CurrentMilliSecond() string {
|
|
return strconv.FormatInt(time.Now().UnixMilli(), 10)
|
|
}
|
|
|
|
func CurrentSecond() string {
|
|
return strconv.FormatInt(time.Now().Unix(), 10)
|
|
}
|
|
|
|
func GetOsName() string {
|
|
if IsWindows() {
|
|
return GetOsType() + " NT"
|
|
} else {
|
|
return GetOsType()
|
|
}
|
|
}
|
|
|
|
func GetOsType() string {
|
|
return runtime.GOOS
|
|
}
|
|
|