Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use the recommended fqdn.FqdnHostname rathen than fqdn.Get #147

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kjetilho
Copy link

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.

cmd/client/main.go Outdated Show resolved Hide resolved
Copy link
Contributor

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@SuperQ
Copy link
Contributor

SuperQ commented Apr 26, 2023

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

kjetilho and others added 2 commits April 26, 2023 17:30
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.

Signed-off-by: Kjetil Torgrim Homme <kjetil.homme@redpill-linpro.com>
make usage message more generic.

Co-authored-by: Ben Kochie <superq@gmail.com>
Signed-off-by: Kjetil Torgrim Homme <kjetil.homme@redpill-linpro.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants