Go building .exe file

Hello guys so I have program and I want to build .exe file for it and supply it to another guy that he could use just .exe file.

But in my program I have KingPin v2 installed and with it I have few cases for it. If I try to launch .exe file from file explorer nothing happens but when I launch it in bash I get asked which case I want to use : parse, download etc.

My questions:

  1. Can I make .exe file which could work with specific case? example: parse.exe which would do parsing part of program.

  2. How do I launch my program as .exe file from file explorer and not bash?


@MantasSilanskas, when you double-click on your program from Windows Explorer, what are you expecting to see? Depending on the answer, there might be different ways to accomplish it. When you double-click it now, Windows tries to execute the program without any arguments, so a command-prompt window is created, the program runs with its default arguments and closes. If you want the program to wait after completing so you can see the output, you can instead run a batch or PowerShell script that runs your program and then waits after your program finishes. If you want to prompt for parameters to KingPin if double-clicked from Explorer, you can do that with PowerShell or by coding a GUI into your program to prompt for options.


Certain go programs are command line applications so it wont open in a GUI, and kingpin looks a pure command line tool where you must use a program like powershell, or cmd.

or if you just need to execute a single command every time,
This program reads a settings.json file in the same folder.


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