2020-03-02 20:37:28 +00:00
|
|
|
// 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...
|
2020-11-11 17:04:34 +00:00
|
|
|
return runtime.GOOS == "android" || isIOS
|
2020-03-02 20:37:28 +00:00
|
|
|
}
|
2020-04-01 15:49:25 +00:00
|
|
|
|
|
|
|
// OS returns runtime.GOOS, except instead of returning "darwin" it
|
|
|
|
// returns "iOS" or "macOS".
|
|
|
|
func OS() string {
|
2020-11-11 17:04:34 +00:00
|
|
|
if isIOS {
|
|
|
|
return "iOS"
|
|
|
|
}
|
2020-04-01 15:49:25 +00:00
|
|
|
if runtime.GOOS == "darwin" {
|
|
|
|
return "macOS"
|
|
|
|
}
|
|
|
|
return runtime.GOOS
|
|
|
|
}
|