Comment #5 on issue 6968 by
l...@webconnex.com: cmd/go: go get
You could do a HEAD request of the URL. If it comes back as 200 OK it's
public, and if it's 404 it's private. When trying to `go get` a
non-existent repo it creates the directory anyway.
Github also has an REST API that could be used:
http://developer.github.com/v3/repos/#get
Another option is to just have an environmental variable that toggles the
behavior of go get for all
github.com repos, regardless if they're public
or private. Downside of that is having to enter your private key password
for public repos, but you only have to do that once every so often.