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