DefaultInterfaces are hardcoded to try eth0 and en0 and advertised by comment for unix-like platforms, but these will never be found on Ubuntu and probably many other linux flavors that use predictable network interface names.
Eg, ethernet is enp4s0f1 for me on Ubuntu 20.04 LTS. examining net.Interfaces() might be a better bet
Hmm, I'll need to give this a bit of thought. I inherited the list from dskit, where the default list of interfaces is more of a hint than trying to be inclusive of all target platforms.
Yo!
DefaultInterfaces
are hardcoded to tryeth0
anden0
and advertised by comment forunix-like platforms
, but these will never be found on Ubuntu and probably many other linux flavors that use predictable network interface names. Eg, ethernet isenp4s0f1
for me on Ubuntu 20.04 LTS. examiningnet.Interfaces()
might be a better bet