Package whois provides simple whois protocol (RFC 3912) implementation.
go get github.com/alenichev/whois
or import as package:
import "github.com/alenichev/whois"
an run go get
without arguments.
import "github.com/alenichev/whois"
ask "whois.iana.org" about "example.com":
output, err := whois.Query("whois.iana.org", "example.com")
if err != nil {
// error handling
}
or (final result, using refer field from IANA's response, if needed):
output, err := whois.QueryAll("example.com")
if err != nil {
// error handling
}
use built-in parser and get Reply struct:
r, err := whois.GetReply("example.com")
if err != nil {
// error handling
}