.travis.golint.sh 716 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. cd "$(dirname $0)"
  3. go get golang.org/x/lint/golint
  4. DIRS=". tcpassembly tcpassembly/tcpreader ip4defrag reassembly macs pcapgo pcap afpacket pfring routing defrag/lcmdefrag"
  5. # Add subdirectories here as we clean up golint on each.
  6. for subdir in $DIRS; do
  7. pushd $subdir
  8. if golint |
  9. grep -v CannotSetRFMon | # pcap exported error name
  10. grep -v DataLost | # tcpassembly/tcpreader exported error name
  11. grep .; then
  12. exit 1
  13. fi
  14. popd
  15. done
  16. pushd layers
  17. for file in *.go; do
  18. if cat .lint_blacklist | grep -q $file; then
  19. echo "Skipping lint of $file due to .lint_blacklist"
  20. elif golint $file | grep .; then
  21. echo "Lint error in file $file"
  22. exit 1
  23. fi
  24. done
  25. popd