From 8145c0cef0afc0582cff450c00082b9a16a07dde Mon Sep 17 00:00:00 2001 From: WAKAYAMA Shirou Date: Sat, 19 Apr 2014 01:05:35 +0900 Subject: [PATCH] forget to commit procs in HostInfo. --- host_windows.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/host_windows.go b/host_windows.go index b18c28a..41ff631 100644 --- a/host_windows.go +++ b/host_windows.go @@ -3,6 +3,7 @@ package main import ( + "github.com/mitchellh/go-ps" "os" "syscall" ) @@ -26,5 +27,13 @@ func (h Host) HostInfo() (HostInfo, error) { uptimemsec, _, err := syscall.Syscall(uintptr(GetTickCount), 0, 0, 0, 0) ret.Uptime = int64(uptimemsec) / 1000 + + procs, err := ps.Processes() + if err != nil { + return ret, err + } + + ret.Procs = uint64(len(procs)) + return ret, nil }