2023-09-05 10:04:38 +01:00
|
|
|
package common
|
|
|
|
|
2023-10-18 14:17:49 +08:00
|
|
|
import "runtime"
|
|
|
|
|
2023-09-05 10:04:38 +01:00
|
|
|
const (
|
|
|
|
AndroidPlatform = "android"
|
2024-08-07 17:13:21 +08:00
|
|
|
IOSPlatform = "ios"
|
2023-10-18 14:17:49 +08:00
|
|
|
WindowsPlatform = "windows"
|
2023-09-05 10:04:38 +01:00
|
|
|
)
|
2023-10-18 14:17:49 +08:00
|
|
|
|
2024-08-07 17:13:21 +08:00
|
|
|
var IsMobilePlatform = func() bool {
|
|
|
|
return OperatingSystemIs(AndroidPlatform) || OperatingSystemIs(IOSPlatform)
|
|
|
|
}
|
|
|
|
|
2023-10-18 14:17:49 +08:00
|
|
|
func OperatingSystemIs(targetOS string) bool {
|
|
|
|
return runtime.GOOS == targetOS
|
|
|
|
}
|