How to prevent creating console window?

There is simple GUI toolkit: https://github.com/js-arias/sparta
For Linux creates two windows, but for Windows first creates console.

I guess there is no way of controlling this from inside Go. As long as Windows considers the app a console app it will open a console window.

If I remember correctly (I haven’t used Windows for quite a while now), you can tell Windows to open the console in a minimized window. Right-click the exe and inspect the properties, I think the relevant setting is somewhere in there.

You can set the relevant bit in the header when building:

go build -ldflags "-H windowsgui"

3 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.