go test1 git hooks를 사용하여 commit 전에 go test 실행하기 (테스트 강제하기) .git/hooks/pre-commit 파일에 저장 후 권한을 755로 설정하면 git commit시 실행됩니다. #!/bin/sh FONT_YELLOW="\033[33m" BG_RED="\033[41m" NO_COLOR="\033[0m" # set test flag here GOTEST="go test -v ./..." # (1) echo "${FONT_YELLOW}>> Run [ `echo ${GOTEST}` ] before commit.${NO_COLOR}" # (2) ${GOTEST} # (3) if [ $? -ne 0 ]; then # (4) echo "${BG_RED}>> Commit fail! Check your code.${NO_COLOR}" # (5) exit 1 fi (1) git co.. 2021. 7. 18. 이전 1 다음