title: Printing output to a command window when golang application is compiled with -ldflags -H=windowsgui
body: <p>I have an application that usually runs silent in the background, so I compile it with</p>
  
  <pre><code>go build -ldflags -H=windowsgui &lt;gofile&gt;
  </code></pre>
  
  <p>To check the version at the command line, I wanted to pass a -V flag to the command line to get the string holding the version to be printed to the command prompt then have the application exit. I added the flag package and code. When I test it with </p>
  
  <pre><code>go run &lt;gofile&gt; -V
  </code></pre>
  
  <p>...it prints the version fine. When I compile the exe, it just exits, printing nothing. I suspect it's the compilation flag causing it to not access the console and sending my text into the bit bucket.</p>
  
  <p>I've tried variations to print to stderr and stdout, using println and fprintf and os.stderr.write, but nothing appears from the compiled application. How should I try printing a string to the command prompt when compiled with those flags?</p>