如何在所有文件夹上运行goimports
,除了来自 Makefile 的 Godeps 和 .git?
使用find
列出所有go
文件并在其上运行命令goimports -w
:
find . -name \*.go -not -path <FOLDER TO IGNORE> -not -path <ANOTHER FOLDER TO IGNORE> -exec goimports -w {} \;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.