I tried various ways to create a Go program that only displays a MessageBox or a standalone GUI window. If I wrote this in C / C ++, I would just define WinMain , leave the main one, and it would be nice to go. It seems to me that as soon as I define the main function, the console window is created automatically. And the main function is required.
package main func main() { ... }
To avoid this, I tried an example that creates WinMain
func WinMain(wproc uintptr) { hInstance := GetModuleHandle(nil) ... }
But the effect is the same: an empty console window and a GUI window: 
source share