title: How to build a .a file in golang
body: <p>I tried <code>go build xxx.go</code>, no file output and no error prompt. I searched and found a solution said should use <code>go install xxx.go</code>, got a error :</p>
  
  <pre><code>go install: no install location for .go files listed on command line (GOBIN not set)
  </code></pre>
  
  <p>I search this error and found the solution is set the environment variable GOBIN, GOPATH and I did but it still does not work.</p>