Added basic project and Cobra CLI structure

This commit is contained in:
Suraj Narwade
2018-01-30 12:35:58 +05:30
parent f2f21b527a
commit 8a33b99056
10 changed files with 739 additions and 0 deletions

19
scripts/check-gofmt.sh Executable file
View File

@@ -0,0 +1,19 @@
GO_FILES=$(find . -path ./vendor -prune -o -name '*.go' -print )
for file in $GO_FILES; do
gofmtOutput=$(gofmt -l "$file")
if [ "$gofmtOutput" ]; then
errors+=("$gofmtOutput")
fi
done
if [ ${#errors[@]} -eq 0 ]; then
echo "gofmt OK"
else
echo "gofmt ERROR - These files are not formated by gofmt:"
for err in "${errors[@]}"; do
echo "$err"
done
exit 1
fi