To compile a Windows GUI app in Go, you need to specify an extra flag during when running
1go build -ldflags -H=windowsgui filename.go
When you do this, the application is compiled as a so-called "GUI binary" instead of as a "console binary". This means that when you start the app, it will run but it will not show up in the Windows taskbar.
-ldflags is used to specify the arguments to pass on each
go tool link invocation. A complete list can be found here.
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.