位置变更,Preview正在重构
This commit is contained in:
@@ -1,19 +1,12 @@
|
||||
//go:build !linux
|
||||
//go:build !linux && !windows
|
||||
|
||||
package process
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// setProcessAttributes 设置进程属性 (非 Linux)
|
||||
// setProcessAttributes 其他平台(macOS/FreeBSD 等)不做特殊设置
|
||||
func setProcessAttributes(cmd *exec.Cmd) {
|
||||
if runtime.GOOS == "windows" {
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{
|
||||
HideWindow: true,
|
||||
}
|
||||
}
|
||||
// 其他平台不做特殊设置
|
||||
// 其他平台不需要特殊设置
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
//go:build windows
|
||||
|
||||
package process
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func setProcessAttributes(cmd *exec.Cmd) {
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{
|
||||
HideWindow: true,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user