summaryrefslogtreecommitdiff
path: root/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/google/gopacket/.travis.golint.sh
blob: 0e267f5216ae72b89dcb5bfdf3d9f611145bdfe2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash

cd "$(dirname $0)"

go get golang.org/x/lint/golint
DIRS=". tcpassembly tcpassembly/tcpreader ip4defrag reassembly macs pcapgo pcap afpacket pfring routing defrag/lcmdefrag"
# Add subdirectories here as we clean up golint on each.
for subdir in $DIRS; do
  pushd $subdir
  if golint |
      grep -v CannotSetRFMon |  # pcap exported error name
      grep -v DataLost |        # tcpassembly/tcpreader exported error name
      grep .; then
    exit 1
  fi
  popd
done

pushd layers
for file in *.go; do
  if cat .lint_blacklist | grep -q $file; then
    echo "Skipping lint of $file due to .lint_blacklist"
  elif golint $file | grep .; then
    echo "Lint error in file $file"
    exit 1
  fi
done
popd