← Blog

Vanity Imports in Golang

Published on 25 December, 2019
Tags: golang

The imports in Golang are the full path of the package including the domain name. It is common to host the packages on Github and use it for import as well. However, there are two problems with it.

github.com/<username>/<repository>/pkg/<xyz> -> <user.tld>/xyz

There are few ways to do it, but all essentially boil down to adding meta tags in the response which go command can parse to figure out where is the actual code located. I am thinking of building a system to easily generate static files as a weekend project.