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