Makefile: Simplify the "test" target.

* Call "go env" just once.

* Use grep -x to match whole line.
This commit is contained in:
Qi Xiao 2020-07-27 12:24:28 +01:00 committed by GitHub
parent a77261e4ea
commit d2e7201163
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,7 +13,7 @@ generate:
go generate ./...
test:
echo "`go env GOOS`/`go env GOARCH`" | egrep -q '^(linux|freebsd|darwin|windows)/amd64$$' \
echo `go env GOOS GOARCH` | egrep -qx '(linux|freebsd|darwin|windows) amd64' \
&& go test -race ./... \
|| go test ./...