From a2387fed68f4b0d2f05a5aba043813681426f4f9 Mon Sep 17 00:00:00 2001 From: TenderIronh Date: Thu, 9 Dec 2021 11:26:59 +0800 Subject: [PATCH] fix build darwin --- common.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/common.go b/common.go index d6aaffc..9456081 100644 --- a/common.go +++ b/common.go @@ -1,6 +1,7 @@ package main import ( + "bytes" "crypto/aes" "crypto/cipher" "crypto/tls" @@ -8,6 +9,7 @@ import ( "fmt" "net" "net/http" + "os/exec" "time" ) @@ -138,3 +140,11 @@ func netInfo() *NetInfo { } return nil } + +func execOutput(name string, args ...string) string { + cmdGetOsName := exec.Command(name, args...) + var cmdOut bytes.Buffer + cmdGetOsName.Stdout = &cmdOut + cmdGetOsName.Run() + return cmdOut.String() +}