To use go.olly.garden modules on your local machine with private GitHub repositories, you need to configure two things:
# 1. Set GOPRIVATE to bypass public proxy for go.olly.garden modules
go env -w GOPRIVATE="go.olly.garden"
# 2. Configure Git to use SSH for GitHub authentication
git config --global url."git@github.com:".insteadOf "https://github.com/"
https://github.com/ollygarden/trellis, Git converts it to git@github.com:ollygarden/trellisTest that everything works:
# Test SSH connection to GitHub
ssh -T git@github.com
# Test Go module download
go mod init test
go get go.olly.garden/trellis
# Test SSH connection
ssh -T git@github.com
# Should return: "Hi username! You've successfully authenticated..."
# Verify GOPRIVATE is set
go env GOPRIVATE
# Should include: go.olly.garden
# Verify Git SSH redirect
git config --global --get url."git@github.com:".insteadOf
# Should return: https://github.com/
# Clear module cache if needed
go clean -modcache