This commit is contained in:
bluepython508 committed 2026-10-22 12:27:19 +01:00
1 parent 3530afb854
commit 6903fcff27
2146 files changed
+112256 -190703

No files matched your search

+17 -1
View File
@@ -1,4 +1,4 @@
// Copyright (c) Tailscale Inc & AUTHORS
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
//go:build darwin
@@ -8,14 +8,30 @@ package hostinfo
import (
"os"
"path/filepath"
"golang.org/x/sys/unix"
)
func init() {
osVersion = lazyOSVersion.Get
packageType = packageTypeDarwin
}
var (
lazyOSVersion = &lazyAtomicValue[string]{f: new(osVersionDarwin)}
)
func packageTypeDarwin() string {
// Using tailscaled or IPNExtension?
exe, _ := os.Executable()
return filepath.Base(exe)
}
// Returns the marketing version (e.g., "15.0.1" or "26.0.0")
func osVersionDarwin() string {
version, err := unix.Sysctl("kern.osproductversion")
if err != nil {
return ""
}
return version
}