From 225094c978d5ae55802d1394f52abee32b7a2004 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Fri, 1 Jun 2018 09:13:21 -0700 Subject: [PATCH] Add a missing require and a missing var declaration to system_info.go --- system/system_info.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/system/system_info.go b/system/system_info.go index 21ee60f1..6773fe0e 100644 --- a/system/system_info.go +++ b/system/system_info.go @@ -2,6 +2,7 @@ package system import ( "os/exec" + "runtime" "strings" "github.com/senorprogrammer/wtf/wtf" @@ -18,13 +19,14 @@ func NewSystemInfo() *SystemInfo { arg := []string{} + var cmd *exec.Cmd switch runtime.GOOS { case "linux": - cmd := exec.Command("uname -a", arg...) + cmd = exec.Command("uname -a", arg...) case "darwin": - cmd := exec.Command("sw_vers", arg...) + cmd = exec.Command("sw_vers", arg...) default: - cmd := exec.Command("sw_vers", arg...) + cmd = exec.Command("sw_vers", arg...) } raw := wtf.ExecuteCommand(cmd)