本站源代码
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

22 行
439B

  1. #!/bin/bash
  2. # ln -s $PWD/pre-commit.sh .git/hooks/pre-commit
  3. go test *.go
  4. RESULT=$?
  5. if [[ $RESULT != 0 ]]; then
  6. echo "REJECTING COMMIT (test failed with status: $RESULT)"
  7. exit 1;
  8. fi
  9. go fmt *.go
  10. for e in $(ls examples); do
  11. go build examples/$e/*.go
  12. RESULT=$?
  13. if [[ $RESULT != 0 ]]; then
  14. echo "REJECTING COMMIT (Examples failed to compile)"
  15. exit $RESULT;
  16. fi
  17. go fmt examples/$e/*.go
  18. done
  19. exit 0
上海开阖软件有限公司 沪ICP备12045867号-1