version: simplify iOS detection now that we require Go 1.16
See https://golang.org/doc/go1.16#darwin No need for build tag tricks anymore.
This commit is contained in:
parent
cad8df500c
commit
7f8519c88f
|
@ -8,15 +8,13 @@ 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
|
||||
return runtime.GOOS == "android" || runtime.GOOS == "ios"
|
||||
}
|
||||
|
||||
// OS returns runtime.GOOS, except instead of returning "darwin" it
|
||||
// returns "iOS" or "macOS".
|
||||
func OS() string {
|
||||
if isIOS {
|
||||
if runtime.GOOS == "ios" {
|
||||
return "iOS"
|
||||
}
|
||||
if runtime.GOOS == "darwin" {
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
// 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.
|
||||
|
||||
// +build ios
|
||||
|
||||
package version
|
||||
|
||||
const isIOS = true
|
|
@ -1,9 +0,0 @@
|
|||
// 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.
|
||||
|
||||
// +build !ios
|
||||
|
||||
package version
|
||||
|
||||
const isIOS = false
|
Loading…
Reference in New Issue