GitHub Repository

Twist generates canonical imports for your Go packages. Since it does not require a running server (ie in existing tools like uber-go/sally and rsc/go-import-redirector), Twist is particularly useful in conjunction with GitHub Pages.

A canonical import path allows you to make your package import a little fancier with a custom domain, for example:

- import "github.com/bobheadxi/zapx"
+ import "go.bobheadxi.dev/zapx"

I use Twist myself to generate import names for my packages at go.bobheadxi.dev, which acts as the source for a GitHub Pages site that performs the redirection.

The CLI can easily generate templates for a single package:

go get -u go.bobheadxi.dev/twist
#          [        source         ] [     canonical     ]
twist -o x github.com/bobheadxi/zapx go.bobheadxi.dev/zapx

Or generate templates for many packages using a flexible configuration format:

twist -c twist.example.yml -o x -readme

Drop by the repository to learn more!