diff --git a/host/host_windows.go b/host/host_windows.go index d89e191b..512b63c3 100644 --- a/host/host_windows.go +++ b/host/host_windows.go @@ -77,7 +77,7 @@ func InfoWithContext(ctx context.Context) (*InfoStat, error) { } { - boot, err := BootTime() + boot, err := BootTimeWithContext(ctx) if err == nil { ret.BootTime = boot ret.Uptime, _ = Uptime() @@ -87,12 +87,12 @@ func InfoWithContext(ctx context.Context) (*InfoStat, error) { { hostID, err := getMachineGuid() if err == nil { - ret.HostID = strings.ToLower(hostID) + ret.HostID = hostID } } { - procs, err := process.Pids() + procs, err := process.PidsWithContext(ctx) if err == nil { ret.Procs = uint64(len(procs)) } @@ -128,7 +128,7 @@ func getMachineGuid() (string, error) { return "", fmt.Errorf("HostID incorrect: %q\n", hostID) } - return hostID, nil + return strings.ToLower(hostID), nil } func Uptime() (uint64, error) { diff --git a/host/types.go b/host/types.go index 1766e7ef..1eff4755 100644 --- a/host/types.go +++ b/host/types.go @@ -5,7 +5,7 @@ import ( ) type Warnings struct { - List []error + List []error } func (w *Warnings) Add(err error) { @@ -21,5 +21,5 @@ func (w *Warnings) Reference() error { } func (w *Warnings) Error() string { - return fmt.Sprintf("Number of warnings: %v", len(w.List)) + return fmt.Sprintf("Number of warnings: %v", len(w.List)) }