Hacker News new | ask | show | jobs
by danielparks 2482 days ago
> Check out your code into some random directory. Copy the directory to a USB drive and walk it over to an air gapped machine (no wi-fi, no ethernet, clean dev environment installed). Copy the directory to the box, make some small code change and try to build your binary.

I don’t follow. Why is the code change important?

Why not just use the go module cache? Seems like a much cleaner solution with very little overhead.

1 comments

The idea of making a change and rebuilding is about proving that the build process does not require a network connection and that you have properly resolved the depencenies on that machine.
The change is unnecessary. You can just rebuild.

If you’ve built once using the standard go module functionality then you will be able to rebuild as long as you don’t pull in more dependencies. Naturally you can move the cache around.