shirou_gopsutil/host_unix.go

18 lines
238 B
Go
Raw Normal View History

2014-04-18 20:28:00 +08:00
// +build linux freebsd
package main
import (
"os"
"syscall"
)
func (h Host) HostInfo() (HostInfo, error) {
ret := HostInfo{}
hostname, err := os.Hostname()
ret.Hostname = hostname
ret.Uptime = sysinfo.Uptime
return ret, nil
}