fix(system): Use os.Hostname
This commit is contained in:
parent
9818565c7d
commit
dcd82e6c50
@ -168,10 +168,7 @@ func SetHostname(hostname string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Hostname() (string, error) {
|
func Hostname() (string, error) {
|
||||||
cmd := exec.Command("hostname")
|
return os.Hostname()
|
||||||
output, err := cmd.CombinedOutput()
|
|
||||||
hostname := strings.TrimSpace(string(output))
|
|
||||||
return hostname, err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func MachineID(root string) string {
|
func MachineID(root string) string {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user