Skip to content

feat: Add hostname label validation tag - #1616

Open
KytnaCode wants to merge 3 commits into
go-playground:masterfrom
KytnaCode:feat/add-hostname-label-validation-tag
Open

feat: Add hostname label validation tag#1616
KytnaCode wants to merge 3 commits into
go-playground:masterfrom
KytnaCode:feat/add-hostname-label-validation-tag

Conversation

@KytnaCode

Copy link
Copy Markdown

Fixes Or Enhances

Add hostname_label validation tag. Resolves #1543.

Make sure that you've checked the boxes below before you submit PR:

  • Tests exist or have been written that cover this particular change.

@go-playground/validator-maintainers

@KytnaCode
KytnaCode requested a review from a team as a code owner August 24, 2026 03:48
Comment thread baked_in.go Outdated
@KytnaCode
KytnaCode force-pushed the feat/add-hostname-label-validation-tag branch from d5ba2d2 to f37be26 Compare September 4, 2026 00:16
@KytnaCode

KytnaCode commented Sep 4, 2026

Copy link
Copy Markdown
Author

The hostname label rule uses local isDigit and isLetter functions that use ascii ranges for efficiency, I can change alpha, alphanum, alphaspace and alphanumspace to use them instead of regex, although, that doesn't work for unicode variants. I can open a pull request for that, what do you think?.

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.

Enhancement: Add "dns_label" or "hostname_label" validator for single-label DNS validation

2 participants