title: How to access command-line arguments passed to a Go program?
body: <p>How do I access command-line arguments in Go? They're not passed as arguments to <code>main</code>.</p>
  
  <blockquote>
    <p>A complete program, possibly created by linking multiple packages, must have one package called main, with a function</p>
  
  <pre><code>func main() { ... }
  </code></pre>
    
    <p>defined. The function main.main() takes no arguments and returns no value. </p>
  </blockquote>