PushProx icon indicating copy to clipboard operation
PushProx copied to clipboard

use the recommended fqdn.FqdnHostname rathen than fqdn.Get

Open kjetilho opened this issue 2 years ago • 1 comments

fqdn.Get is deprecated by the author:

// Deprecated: // This function has bad API, works poorly and is replace by // FqdnHostname. Please please do not use it. It will be removed // in the next version.

The old function resolves the FQDN by doing a forward lookup of the hostname, and then a reverse lookup of the IP address. This may lead to surprising results. The new function aims to give the same result as hostname -f.

Another problem with the fqdn.Get API is that it has no facility to return errors. This patch throws away the actual error for simplicity's sake, though.

kjetilho avatar Apr 26 '23 14:04 kjetilho

This needs a DCO sign-off. You can use git commit -s --amend to add it.

SuperQ avatar Apr 26 '23 15:04 SuperQ