var execCommand … func getSessionBusPlatformAddress() (string, error) { … } // tryDiscoverDbusSessionBusAddress tries to discover an existing dbus session // and return the value of its DBUS_SESSION_BUS_ADDRESS. // It tries different techniques employed by different operating systems, // returning the first valid address it finds, or an empty string. // // * /run/user/<uid>/bus if this exists, it *is* the bus socket. present on // Ubuntu 18.04 // * /run/user/<uid>/dbus-session: if this exists, it can be parsed for the bus // address. present on Ubuntu 16.04 // // See https://dbus.freedesktop.org/doc/dbus-launch.1.html func tryDiscoverDbusSessionBusAddress() string { … } func getRuntimeDirectory() (string, error) { … } func fileExists(filename string) bool { … }