| Don't couple your Go code to GitHub(iain.rocks) | |
| 322 points by birdculture 16 days ago | 174 comments | |
tl;dr: Because Go uses import paths that double as fetch locations, using `github.com/...` directly couples your code to a specific git host, making migrations painful (the author cites a company stuck paying for GitHub, GitLab, and Azure DevOps simultaneously). The fix is to use a custom domain (e.g., `go.iain.rocks/boneclone`) that serves Go's `go-import` meta tags, letting you repoint to a different host without breaking consumers. The post includes an Nginx config and HTML template to set this up. | |
HN Discussion:
| |