Strip dependency metadata

I want to remove all metadata from the go binary.

I am stuck on removing the dependencies. The command

go version -m dist/main

shows the dependencies for my binary

I can’t find any flags for disabling this behavior

Hello. There is no easy way to trim this information from the binary, since it’s required for go runtime and is incorporated during the build process. You can experiment with -trimpath (has some side effects now, probably bugs), or -ldflags="-s -w". It won’t help a lot tho