goimports.sh 403 B

123456789101112131415161718
  1. #!/usr/bin/env bash
  2. find_files() {
  3. find . -not \( \
  4. \( \
  5. -wholename '.github' \
  6. -o -wholename './build/_workspace' \
  7. -o -wholename './build/bin' \
  8. -o -wholename './crypto/bn256' \
  9. -o -wholename '*/vendor/*' \
  10. \) -prune \
  11. \) -name '*.go'
  12. }
  13. GOFMT="gofmt -s -w";
  14. GOIMPORTS="goimports -w";
  15. find_files | xargs $GOFMT;
  16. find_files | xargs $GOIMPORTS;