version: add IsMobile func

And use it control/controlclient.
This commit is contained in:
Brad Fitzpatrick
2020-03-02 12:37:28 -08:00
parent 11489a6e67
commit 7172f3dbf4
3 changed files with 20 additions and 8 deletions

15
version/prop.go Normal file
View File

@ -0,0 +1,15 @@
// 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" ||
(runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64"))
}