Does the server not run? If so, what error do you get?
Or is it that you can not connect to it? Binding localhost:8089 will only accept connections made through the loopback device. Usually you want to bind an IP that exist on a device that is routable from the outside world or 0.0.0.0/:: to bind all IPs.
Yes, you can find out ybout all available network interfaces using net.Interfaces(), then you can iterate over them and use net.interface.Addrs to get their IP addresses.
After that you’ll have a list of IP addresses, but you wont know which of them is publicly available.
The IP to bind to is usually given as a configuration option or simply 0.0.0.0 or :: are used to bind to all available IP addresses.
Due to security reasons, I’d always bind to a single IP only once the software goes live.
I’m less strict about this when the host itself is not publicly available but only accessible through a loadbalancer/reverse proxy.