blob: 302209c09d9e35fcda46c3ce4e2feb9022cb0c48 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
// 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
}
|