title: What's the proper way to "go get" a private repository?
body: <p>I'm searching for the way to get <code>$ go get</code> work with private repository, after many google try.  </p>
  
  <p>The first try:</p>
  
  <pre><code>$ go get -v gitlab.com/secmask/awserver-go
  Fetching https://gitlab.com/secmask/awserver-go?go-get=1
  https fetch failed.
  Fetching http://gitlab.com/secmask/awserver-go?go-get=1
  Parsing meta tags from http://gitlab.com/secmask/awserver-go?go-get=1 (status code 200)
  import "gitlab.com/secmask/awserver-go": parse http://gitlab.com/secmask/awserver-go?go-get=1: no go-import meta tags
  package gitlab.com/secmask/awserver-go: unrecognized import path "gitlab.com/secmask/awserver-go
  </code></pre>
  
  <p>Yep, it did not see the meta tags because I could not know how to provide login information.</p>
  
  <p>The second try:</p>
  
  <p>Follow <a href="https://gist.github.com/shurcooL/6927554" rel="noreferrer">https://gist.github.com/shurcooL/6927554</a>. Add config to .gitconfig.</p>
  
  <pre><code>[url "ssh://git@gitlab.com/"]
      insteadOf = https://gitlab.com/
  $ go get -v gitlab.com/secmask/awserver-go --&gt; not work
  $ go get -v gitlab.com/secmask/awserver-go.git --&gt; work but I got src/gitlab.com/secmask/awserer-go.git
  </code></pre>
  
  <p>Yes it work but with <code>.git</code> extension with my project name, I can rename it to original but do it everytime <code>$ go get</code> is not so good, is there an otherway?</p>