title: Having multiple main functions on Go
body: <p>As a Python and Django developer, I can run any piece of code in my project using a script independently. </p>
  
  <p>I am not too sure how to achieve the same thing in Go, as it looks like each Go project should only have one main executable file.</p>
  
  <p>I'd like to call a function in my project from cronjob, but I'm not too sure how to add that. Using flags in my main function is the only way I can think of doing this. But it will look pretty confusing if my script accepts additional flags by itself like the following:</p>
  
  <pre><code>go run server.go --debug --another-flag --script-name &lt;MY-SCRIPT&gt; --my-script-flag-one &lt;FLAG-ONE&gt; --my-script-flag-two &lt;FLAG-TWO&gt;
  </code></pre>
  
  <p>Is there any elegant way of doing this?</p>