node build fixed

This commit is contained in:
ra_ma
2025-09-20 14:08:38 +01:00
parent c6ebbe069d
commit 3d298fa434
1516 changed files with 535727 additions and 2 deletions

View File

@@ -0,0 +1,30 @@
package util
import (
"fmt"
"os/exec"
"runtime"
"strings"
)
func GetMemAddrStr(v interface{}) string {
return fmt.Sprintf("%p", v)
}
func ProgramIsRunning(name string) bool {
var cmd *exec.Cmd
switch runtime.GOOS {
case "windows":
cmd = NewCmd("tasklist")
case "linux":
cmd = NewCmd("pgrep", name)
case "darwin":
cmd = NewCmd("pgrep", name)
default:
return false
}
output, _ := cmd.Output()
return strings.Contains(string(output), name)
}