I'm using this code to differentiate the platform my application is running on:
import (
"runtime"
)
func Get() (string, error) {
// Detect platform we are running on.
if runtime.GOOS == "windows" {
// ...
} else if runtime.GOOS == "darwin" {
// ...
} else if runtime.GOOS == "linux" {
// ...
}
// ...
}
Now, I intend to detect whether my application is running on Raspberry Pi and if so, which architecture, i.e. ARM, x86, ...
What's the most reliable to do so? Any standard practice which I might be missing?