According to [Reproducible-Builds.org](https://reproducible-builds.org/docs/definition/):
> A build is reproducible if given the same source code, build environment and build instructions, any party can recreate bit-by-bit identical copies of all specified artifacts.
So, things we need to pay attention here are:
- the source is the same
- the dependencies are the same, in the same versions
-`chtimes` are the same
- build path is the same
- any other tools needed to compile must be the same, in the same versions
While this might sound complicated, rest assured GoReleaser can help you with most of these items!
## **Reproducible Builds with GoReleaser**
GoReleaser will by default inject a `ldflag` with the current timestamp as `main.date`, which you can use to display build time information. We will want to change that to use some fixed date, for instance, the date of the commit being built.
To avoid changes from one machine to another, we will also want to use `-trimpath`.
Finally, we'll want to make sure the repo code haven't changed, e.g., when building a tag, we want to make sure it wasn't deleted and pushed again (i.e., moved).
We can achieve that with a config that looks like this: