Skip to content

Commit 225094c

Browse files
Add a missing require and a missing var declaration to system_info.go
1 parent 53c1a79 commit 225094c

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎system/system_info.go‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package system
22

33
import (
44
"os/exec"
5+
"runtime"
56
"strings"
67

78
"github.com/senorprogrammer/wtf/wtf"
@@ -18,13 +19,14 @@ func NewSystemInfo() *SystemInfo {
1819

1920
arg := []string{}
2021

22+
var cmd *exec.Cmd
2123
switch runtime.GOOS {
2224
case "linux":
23-
cmd := exec.Command("uname -a", arg...)
25+
cmd = exec.Command("uname -a", arg...)
2426
case "darwin":
25-
cmd := exec.Command("sw_vers", arg...)
27+
cmd = exec.Command("sw_vers", arg...)
2628
default:
27-
cmd := exec.Command("sw_vers", arg...)
29+
cmd = exec.Command("sw_vers", arg...)
2830
}
2931

3032
raw := wtf.ExecuteCommand(cmd)

0 commit comments

Comments
 (0)
⌂ 换网址