Skip to content

waitingkuo/domainutil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

domainutil

Simple domain parser

Installation

go get github.com/waitingkuo/domainutil

Example

package main

import (
  "fmt"
  "github.com/waitingkuo/domainutil"
)

func main() {

  domain, err := domainutil.ParseFromRawURL("http://www.google.com")
  if err != nil {
    panic(err)
  }

  fmt.Println("RootDomain:", domain.RootDomain)
  fmt.Println("SubDomain:", domain.SubDomain)
}

Output

RootDomain: google.com
SubDomain: www

Others

Feel free to leave any commands or issues

About

Simple domain parser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages