package
module
Version:
v0.0.0-...-6f60894
Opens a new window with list of versions in this module.
Published: May 1, 2018
License: Apache-2.0
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
go-fqdn
Simple wrapper around net
and os
golang standard libraries providing Fully Qualified Domain Name of the machine.
Usage
Get the library...
$ go get github.com/Showmax/go-fqdn
...and write some code.
package main
import (
"fmt"
"github.com/Showmax/go-fqdn"
)
func main() {
fmt.Println(fqdn.Get())
}
fqdn.Get()
returns:
- machine's FQDN if found.
- hostname if FQDN is not found.
- return "unknown" if nothing is found.
Documentation
¶
Get Fully Qualified Domain Name
returns "unknown" or hostanme in case of error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.