mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-26 03:25:35 +00:00
19b0cfe89e
Work with either way for now on iOS (darwin/arm64 vs ios/arm64). In February when Go 1.16 comes out we'll have a universal binary for darwin/arm64 (macOS) and will drop support for Go 1.15 and its darwin/amd64 meaning iOS. (it'll mean macOS). Context: * https://tip.golang.org/doc/go1.16#darwin * https://github.com/golang/go/issues/38485 * https://github.com/golang/go/issues/42100
27 lines
636 B
Go
27 lines
636 B
Go
// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package version
|
|
|
|
import "runtime"
|
|
|
|
// IsMobile reports whether this is a mobile client build.
|
|
func IsMobile() bool {
|
|
// Good enough heuristic for now, at least until Apple makes
|
|
// ARM laptops...
|
|
return runtime.GOOS == "android" || isIOS
|
|
}
|
|
|
|
// OS returns runtime.GOOS, except instead of returning "darwin" it
|
|
// returns "iOS" or "macOS".
|
|
func OS() string {
|
|
if isIOS {
|
|
return "iOS"
|
|
}
|
|
if runtime.GOOS == "darwin" {
|
|
return "macOS"
|
|
}
|
|
return runtime.GOOS
|
|
}
|