Hasty Briefsbeta

Bilingual

Don't couple your Go code to GitHub

4 hours ago
  • Go's import path is tied to the code's hosting location, which couples the code to a specific provider like GitHub.
  • Switching hosting providers (e.g., from GitHub to GitLab) requires changing import paths in code, making migration difficult and costly.
  • Using custom domains (e.g., go.iain.rocks) as the import path allows changing the underlying hosting without modifying code.
  • Custom domains are recommended for commercial Go teams to avoid unnecessary coupling and reduce overhead.
  • The article provides an example Nginx configuration and index.html to set up a custom domain for Go package imports.