- update service

- update tool
master
李光春 2 years ago
parent f498827498
commit 71b7bb5cb6

@ -0,0 +1 @@
### 服务

@ -0,0 +1 @@
### 工具

@ -0,0 +1,18 @@
package system
import "runtime"
// IsMac 是否为Mac
func IsMac() bool {
return runtime.GOOS == "darwin"
}
// IsWindows 是否为Windows
func IsWindows() bool {
return runtime.GOOS == "windows"
}
// IsLinux 是否为Linux
func IsLinux() bool {
return runtime.GOOS == "linux"
}

@ -0,0 +1,33 @@
package system
import "testing"
func TestIsMac(t *testing.T) {
t.Log(IsMac())
}
func BenchmarkIsMac(b *testing.B) {
for i := 0; i < b.N; i++ {
IsMac()
}
}
func TestIsWindows(t *testing.T) {
t.Log(IsWindows())
}
func BenchmarkIsWindows(b *testing.B) {
for i := 0; i < b.N; i++ {
IsWindows()
}
}
func TestIsLinux(t *testing.T) {
t.Log(IsWindows())
}
func BenchmarkIsLinux(b *testing.B) {
for i := 0; i < b.N; i++ {
IsWindows()
}
}
Loading…
Cancel
Save