I want to write linux distribution independant Golang code. I need detect which linux distribution and need to run distribution specific commands within program. Like dpkg in case of Ubuntu and rpm -q in case of RHEL.
You can use exec.Cmd to run lsb_release -a or uname -a and parse the output to find out the distribution.