From 1ac9a236e04de003c30c18c10bb82dee13105867 Mon Sep 17 00:00:00 2001 From: xpetit <32063953+xpetit@users.noreply.github.com> Date: Thu, 30 Jul 2020 14:18:04 +0200 Subject: [PATCH] Enforce good formatting --- go/exam/entrypoint.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/go/exam/entrypoint.sh b/go/exam/entrypoint.sh index 562ffb12e..f60b3c1b1 100755 --- a/go/exam/entrypoint.sh +++ b/go/exam/entrypoint.sh @@ -13,8 +13,13 @@ first_file=$(echo "$EXPECTED_FILES" | cut -d' ' -f1) mkdir -p "$(dirname "$first_file")" cat > "$first_file" -# Format code -goimports -w . +# Check formatting +s=$(goimports -d .) +if test "$s"; then + echo '$ goimports -d .' + echo "$s" + exit 1 +fi # Check restrictions if test "$ALLOWED_FUNCTIONS" && test "$EXPECTED_FILES"; then