I have some Linux code in golang:
import "syscall"
var info syscall.Sysinfo_t
err := syscall.Sysinfo(&info)
totalRam := info.Totalram
I'd like to port this to Mac OS X. I see that Sysinfo is available on Linux but not on Mac:
Linux:
$ go list -f '{{.GoFiles}}' syscall | sed -e "s/[][]//g" | xargs fgrep --color -Iwn Sysinfo
syscall_linux.go:962://sysnb Sysinfo(info *Sysinfo_t) (err error)
zsyscall_linux_amd64.go:822:func Sysinfo(info *Sysinfo_t) (err error) {\
Mac:
$ go list -f '{{.GoFiles}}' syscall | sed -e "s/[][]//g" | xargs fgrep --color -Iwn Sysinfo
# No results
What is the correct way to get the system RAM info on Mac?