3 ms·
Go always feels like an amateur language to me, I’ve given up on it. This feels right in line - similar to the hardcode GitHub magic.
by JBReefer 7y ago
Go always feels like an amateur language to me, I’ve given up on it. This feels right in line - similar to the hardcode GitHub magic.
- reificator 7y agoI could be wrong, but I don't believe there is "hardcoded[d] GitHub magic". IIRC I have used GitLab and Bitbucket and self-hosted Gitea instances the same exact way, and I'm fairly sure there was an hg repo in one of those. Don't recall doing anything out of the ordinary compared to how I would use a github URL.
- heinrich5991 7y agoThere are a couple of hosting services hardcoded in Go. I believe it was about splitting the URL into the actual URL and the branch name.
- Nullabillity 7y agohttps://github.com/golang/go/blob/e6ebbe0d20fe877b111cf4ccf8349cba129d6d3a/src/cmd/go/internal/get/vcs.go#L1022 https://github.com/golang/go/blob/e6ebbe0d20fe877b111cf4ccf8... Ouch, Go never ceases to amaze. The Bitbucket case[0] is even more crazy, calling out to the Bitbucket API to figure out which VCS to use. It has a special case for private repositories, but seems to hard-code cloning over HTTPS. If only we had some kind of universal way to identify resources, that told you how to access it... [0]: https://github.com/golang/go/blob/e6ebbe0d20fe877b111cf4ccf8349cba129d6d3a/src/cmd/go/internal/get/vcs.go#L1113 https://github.com/golang/go/blob/e6ebbe0d20fe877b111cf4ccf8...
- reificator 7y agoThanks for the reference to prove me wrong. Wow, that's sad. I'm glad it works seamlessly, don't get me wrong, but I was assuming I could chalk it up to defacto standards between the various vendors here.
- deleted 7y ago[deleted]