Skip to content

Validate domain patterns #16

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

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

Conversation

gohumble
Copy link
Contributor

Hello again,

I have added isDomainName function. This will validate the domain name using the isDomainName function from golangs DNS lib. So this should be very solid. This function does not have public scope. That's why I had to copy it.

I recognized the same issues as described in #12
This will also validate host names in emails (such as [email protected]). This is because of the stripURLParts call before checking the domain name.

[email protected] will not fail the validation.

Cheers

added isDomainName
@jenpet
Copy link

jenpet commented Sep 22, 2020

Hi, I just stumbled across this enhancement and it is also relevant for me tbh to verify whether I'm working with a valid domain name. Is there any reason not to include this PR into the utils?

@gohumble
Copy link
Contributor Author

Maintainers seem to be inactive. Better create your own fork or checkout mine.
https://github.com/gohumble/go-domain-util

@gohumble gohumble changed the title Validate domain Patterns Validate domain patterns Sep 25, 2020
@bobesa
Copy link
Owner

bobesa commented Apr 10, 2025

Sorry for the in-activity, the tests are failing atm for this branch. I'm happy to take this one in @gohumble but it should not break the default functionality.

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.

3 participants