- To list all dependencies:
go list std | tr -d "\[|\]" | tr " " "\n" | sort -u > std-library
go list -f {{.Deps}} | tr -d "\[|\]" | tr " " "\n" | sort -u > all-dependencies
sort std-library std-library all-dependencies | uniq -u
Others:
go list -f {{.Deps}} # this lists all dependencies
go list -f '{{ .Imports }}' # just list what is imported (not full transitive dependenciesdepdencnies)
go list std # list packages in the standard library you should exclude from the Deps/Imports lists