Prevent go fmt check from failing under make -j10 test

Under high paralellism we would be regenerating the plugin source
while doing the initial `go fmt` read.

Instead simply exclude the generated file.
This commit is contained in:
Peter Rabbitson 2020-03-12 04:41:09 +01:00
parent 0819fe6f4a
commit 81cb535c52

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
T="$(mktemp)"
find . -name '*.go' | xargs gofmt -l > "$T"
find . -name '*.go' '!' -path ./plugin/loader/preload.go | xargs gofmt -l > "$T"
if [ -n "$(cat $T)" ]; then
echo "Following Go code is not formatted."