Closed
Description
go version go1.9.4 darwin/amd64
When Git parses a URL, it checks to see that the :
is followed by a //
, otherwise it considers the URL to be have [user@]host:path
syntax. This is documented in the Git URLs documentation page. However, go get
cannot understand the scp-like syntax, this behavior is incorrect.
- See
is_url
in url.c:19 which shows the correct behavior, called fromtransport_get
at transport.c:828 - See
isSecure
in vcs.go:56 which shows the incorrect behavior
Here's how to reproduce:
cd $GOPATH/src
mkdir gogetbug
cd gogetbug
git init
git remote add origin git:gogetbug.git
echo $'package main\nfunc main() {}' > main.go
go get -u
The resulting error message is:
package gogetbug: cannot download, git:gogetbug.git uses insecure protocol
This is incorrect, the actual protocol here is SSH and go get
is parsing it incorrectly. The workaround is to not have a Git server named git
, but isn't that the most sensible name for your Git server?