mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-04 12:52:28 +08:00
22 lines
295 B
Go
22 lines
295 B
Go
//go:build windows
|
|
// +build windows
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|