I need to write a Dockerfile to my project that needs lots of go get
s to external packages. Is there any way to get a list of external packages to import? I want to know every external package that I need to put in Dockerfile.
You can use the project cespare/deplist
Or check this thread which uses go list
.
go list -f '{{.ImportPath}}' P/... | xargs -n 1 deplist | grep -v P | sort -u
with
P
being the partial package path.