mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-12 16:52:29 +08:00
[FEATURE] system add option (#87)
This commit is contained in:
18
system/os_windows.go
Normal file
18
system/os_windows.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func WithWinHide() Option {
|
||||
return func(c *exec.Cmd) {
|
||||
if c.SysProcAttr == nil {
|
||||
c.SysProcAttr = &syscall.SysProcAttr{
|
||||
HideWindow: true,
|
||||
}
|
||||
} else {
|
||||
c.SysProcAttr.HideWindow = true
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user