I am wanting to write a utility that does some reporting based on data available in the /proc directory.
Is this as simple as reading and parsing the contents of the virtual file I am interested in? I have seen this approach implemented in Python when doing similar things.
Is there a superior way to do this in Go?
For backstory, I am using ZFS on Linux and want to retrieve data from this virtual file: /proc/spl/kstat/zfs/arcstats
This is a Python program that operates directly on that file.
Is this as simple as reading and parsing the contents of the virtual file I am interested in?
As far as I know: yes.
But you might try looking at github.com/c9s/goprocinfo to see what they do there, or if you can use that package instead.
See also this SO question and answer.