File: README.md

package info (click to toggle)
golang-github-showmax-go-fqdn 0.0~git20160909.2501cdd-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, buster-backports
  • size: 56 kB
  • sloc: makefile: 2
file content (26 lines) | stat: -rw-r--r-- 459 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# 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.