github.com/juju/juju@v0.0.0-20240430160146-1752b71fcf00/core/os/base_darwin.go (about) 1 // Copyright 2024 Canonical Ltd. 2 // Licensed under the LGPLv3, see LICENCE file for details. 3 4 package os 5 6 import ( 7 "syscall" 8 9 corebase "github.com/juju/juju/core/base" 10 ) 11 12 var sysctlVersion = func() (string, error) { 13 return syscall.Sysctl("kern.osrelease") 14 } 15 16 func readBase() (corebase.Base, error) { 17 channel, err := sysctlVersion() 18 if err != nil { 19 return corebase.Base{}, err 20 } 21 return corebase.ParseBase("osx", channel) 22 }