patchman/client/utils/hostname.go

12 lines
152 B
Go

package utils
import "os"
func GetHostname() string {
hostname, err := os.Hostname()
if err != nil {
hostname = "localhost"
}
return hostname
}