We discuss the
replace directive in
go.mod: why it is needed for local verification of fixes before a release, how the two replacement forms work (to a local path and to another module path/version), how to connect a neighboring module through
replace, and why this can easily turn into “works only on my machine” (CI, reproducibility, limitations in some commands). At the end, there is a checklist for when
replace is appropriate, and common mistakes.