MCPcopy Index your code
hub / github.com/tailscale/tailscale / OS

Function OS

version/prop.go:41–58  ·  view source on GitHub ↗

OS returns runtime.GOOS, except instead of returning "darwin" it returns "iOS" or "macOS".

()

Source from the content-addressed store, hash-verified

39// OS returns runtime.GOOS, except instead of returning "darwin" it returns
40// "iOS" or "macOS".
41func OS() string {
42 // If you're wondering why we have this function that just returns
43 // runtime.GOOS written differently: in the old days, Go reported
44 // GOOS=darwin for both iOS and macOS, so we needed this function to
45 // differentiate them. Then a later Go release added GOOS=ios as a separate
46 // platform, but by then the "iOS" and "macOS" values we'd picked, with that
47 // exact capitalization, were already baked into databases.
48 if IsAppleTV() {
49 return "tvOS"
50 }
51 if runtime.GOOS == "ios" {
52 return "iOS"
53 }
54 if runtime.GOOS == "darwin" {
55 return "macOS"
56 }
57 return runtime.GOOS
58}
59
60// IsMacGUIVariant reports whether runtime.GOOS=="darwin" and this one of the
61// two GUI variants (that is, not tailscaled-on-macOS).

Callers 8

defaultHostinfoFunction · 0.92
NewFunction · 0.92
SetMethod · 0.92
updateStatusLockedMethod · 0.92
authReconfigLockedMethod · 0.92
runPollLoopMethod · 0.92

Calls 1

IsAppleTVFunction · 0.85

Tested by

no test coverage detected