milvus/scripts/gofmt.sh
cai.zhang c7861c2dba Add the check of C++ code in the CI progress
Signed-off-by: cai.zhang <cai.zhang@zilliz.com>
2020-11-18 10:07:05 +08:00

13 lines
245 B
Bash
Executable File

#!/usr/bin/env bash
SCRIPTS_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
GO_SRC_DIR="${SCRIPTS_DIR}/$1"
if test -z "$(gofmt -d $GO_SRC_DIR)"; then
exit 0
else
gofmt -d $GO_SRC_DIR
echo "Please format your code by gofmt!"
exit 1
fi