go get github.com/jerbe/go-utils
import (
"fmt"
utils "github.com/jerbe/go-utils"
)
func main() {
// print the local host name
fmt.Println(utils.GetHostname())
// >> jerbe-mac
// print local IP
fmt.Println(utils.GetLocalIPv4())
// >> 192.168.31.100
...
}