Skip to content

A Cloudflare Worker that exposes custom import paths for your Go packages

Notifications You must be signed in to change notification settings

ivanvanderbyl/go-import-worker

Repository files navigation

Go Import cloudflare worker

This is a simple Cloudflare worker for rendering the necessary HTML Meta tags to host Go modules on your own domain, or use your own domain as module import path.

Example

This allows ivan.dev/custompkg to be hosted at github.com/ivanvanderbyl/custompkg and installed with go get ivan.dev/custompkg. There are two main benefits to this: 1. I can change VCS providers without breaking anyones code, 2. It looks good.

For more information on how this works, see the Go docs

Usage

  1. Fork this repo
  2. Edit src/packages.ts to contain the packages you want host
  3. Deploy this worker to Cloudflare using wrangler publish
  4. Configure the worker in Cloudflare to respond to each path that you configured in step 2, remember to include a * on the end to match query params from go get. Setup example

About

A Cloudflare Worker that exposes custom import paths for your Go packages

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published