I maintain go-ps, a Go library for finding, listing, and inspecting processes. Its README describes OS-specific implementations for listing and manipulating processes in a platform-safe way, across Linux, Mac OS X, Solaris, and Windows.
The go-ps repository is on @mitchellh's GitHub. I record its repository ownership as @mitchellh.
The go-ps repository has 1,489 stars, 254 forks.
The go-ps repository history is Started 2014-04, last updated 2022-11.
The README presents go-ps as educational for advanced Go features, including build tags, accessing DLL methods for Windows, cgo for Darwin.
On Darwin, go-ps uses the sysctl syscall to retrieve the process table.
On Unix, go-ps uses procfs at /proc to inspect the process tree.
On Windows, go-ps uses the Windows API, including CreateToolhelp32Snapshot, for a point-in-time snapshot of the process table.
go get github.com/mitchellh/go-ps
The README lists FreeBSD support and Plan9 support as desirable features that are not implemented for this library; it does not say whether or when either will be implemented.
I describe go-ps as a way to find, list, and inspect processes from Go (golang).