GoLang-如何以“隐藏”状态执行/生成进程

This may only pertain to Windows, but I want to spawn a process from my GO program so that it runs hidden - the process will calculate some results and return them over stdout. I just don't want the annoying command window to popup while it is running (it's really just a background calculation process).

How can you execute another process 'hidden'?

Thanks!

Try something like this

var attr os.ProcAttr 
attr.Sys.HideWindow = true
p, err := os.StartProcess("whatever", nil, &attr)

That sets the STARTF_USESHOWWINDOW flag in windows which should stop the called process opening up a cmd window.

See the Microsoft documentation