packageurls
← Blog

2026-09-24

What go get actually asks your domain

Your import path and your git host are completely separate things. The go tool figures out how to connect them with a single HTTPS request, and understanding exactly what that request does makes the whole system really obvious.

When you run go get go.packageurls.dev/oakfield/ledger, the go tool makes one request:

GET https://go.packageurls.dev/oakfield/ledger?go-get=1

It reads one meta tag from the response:

<meta name="go-import" content="go.packageurls.dev/oakfield/ledger git https://github.com/oakfield/ledger">

Three fields: the import prefix, the version control system, and the repository root. That is the whole protocol; everything after it is ordinary git.

Because the tag is the only thing the go tool reads, the repository can move without the import path changing. You update the third field and the next go get follows it; nobody who imports your package has to do anything.

Two details are worth knowing here. The prefix matches subpackages too; a request for go.packageurls.dev/oakfield/ledger/internal/x?go-get=1 gets the same tag, so you do not need separate entries for every package in your module. A request without ?go-get=1 is a human in a browser; you redirect them to the repository instead of showing them a blank page.

Package URLs serves that tag for you, over TLS, on a hostname you own.