summaryrefslogtreecommitdiff
path: root/hostname_linux.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-03-22 08:30:27 -0500
committerJeff Carr <[email protected]>2025-03-22 08:30:27 -0500
commit88e87f5c1a3b208afdf505145fff406167411c0e (patch)
treee521c22b3279d356b5d3245e1577423b30f43780 /hostname_linux.go
parentb2ed4102763421924b29ab4bb6be1a1e5b4b9647 (diff)
use hostname.Get()v0.0.102
Diffstat (limited to 'hostname_linux.go')
-rw-r--r--hostname_linux.go22
1 files changed, 0 insertions, 22 deletions
diff --git a/hostname_linux.go b/hostname_linux.go
deleted file mode 100644
index 4ab6dee..0000000
--- a/hostname_linux.go
+++ /dev/null
@@ -1,22 +0,0 @@
-package main
-
-import (
- "fmt"
- "os"
- "syscall"
-)
-
-// GetFullHostname returns the hostname + domain name (if set).
-func getFullHostname() (string, error) {
- host, err := os.Hostname()
- if err != nil {
- return "", fmt.Errorf("failed to get hostname: %w", err)
- }
-
- domain, err := getDomainName()
- if err != nil || domain == "" {
- return host, nil // fallback to short hostname
- }
-
- return fmt.Sprintf("%s.%s", host, domain), nil
-}