您已经在做:
$(go list ./... | grep -v /vendor/)
该grep -v /vendor/
部分是排除/vendor/
目录。因此,只需对您的Store
目录执行相同的操作:
go test $(go list ./... | grep -v /Store/) -coverprofile .testCoverage.txt
请注意,/vendor/
不必排除这种方式(除非您使用的是Go的真正旧版本)。如果您使用的是旧版Go,则可以将它们结合使用:
go test $(go list ./... | grep -v /vendor/ | grep -v /Store/) -coverprofile .testCoverage.txt