Think before you speak, read before you think.

go list找到所有的 imports

go 找到所有的 imports , 先找到所有的目录

find . -type dir | grep -v vendor | grep -v .git | xargs
. ./handlers ./logger ./router ./routes ./static

上面就是所有的目录了,执行 go list 找到所有的 imports

go list -f '{{ join .Imports "\n" }}' . ./handlers ./logger ./router ./routes ./static | sort | uniq

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *