Inspect Go modules in a compiled binary

I’ve used https://github.com/JoakimSoderberg/gobindep for this.

It only works for binaries compiled with go module support.

You can also use https://github.com/anchore/grype to inspect a go binary, though it won’t give a full listing of modules.