-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUILD] Move golang linter into a script
We can reuse the array definition to perform both the go-vet and go-import operations. This also sets the stage for running the linter within a docker instance later in the series. Change-Id: I5fcda6c441cfef49837b855a2d6bb2cc3d300847 Signed-off-by: Greg Haskins <gregory.haskins@gmail.com>
- Loading branch information
Showing
3 changed files
with
19 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
declare -a arr=("./core" "./events" "./examples" "./peer" "./protos" "./orderer") | ||
|
||
for i in "${arr[@]}" | ||
do | ||
echo "Checking $i" | ||
go vet $i/... | ||
OUTPUT="$(goimports -srcdir $GOPATH/src/github.com/hyperledger/fabric -l $i)" | ||
if [[ $OUTPUT ]]; then | ||
echo "The following files contain goimports errors" | ||
echo $OUTPUT | ||
echo "The goimports command must be run for these files" | ||
exit 1 | ||
fi | ||
done |