1// +build freebsd darwin 2 3package operatingsystem 4 5import ( 6 "errors" 7 "os/exec" 8) 9 10// GetOperatingSystem gets the name of the current operating system. 11func GetOperatingSystem() (string, error) { 12 cmd := exec.Command("uname", "-s") 13 osName, err := cmd.Output() 14 if err != nil { 15 return "", err 16 } 17 return string(osName), nil 18} 19 20// IsContainerized returns true if we are running inside a container. 21// No-op on FreeBSD and Darwin, always returns false. 22func IsContainerized() (bool, error) { 23 // TODO: Implement jail detection for freeBSD 24 return false, errors.New("Cannot detect if we are in container") 25} 26