Skip to content

chmike/domain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoDoc Build codecov Go Report Status release

domain.Check()

This package contains a single function that checks the validity of a host name domain name.

A domain name must respect rules defined in

The domain.Check function ensures that the given host name respect those rules. If not, it returns an error explaining the detected problem.

Prerequisites

The package has no prerequisites and external dependencies.

Installation

To install or update this package use the instruction:

go get github.com/chmike/domain@latest

Usage examples

The Check function can be used to check the validity of host or domain names.

name := "host.example.com"
if err := domain.Check(name); if err != nil {
    log.Fatalf("invalid host name '%s': %v", name, err)
}

About

Go function to check domain name validity

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages