forked from edwingeng/wuid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlint.sh
executable file
·39 lines (29 loc) · 816 Bytes
/
lint.sh
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
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
[[ "$TRACE" ]] && set -x
pushd `dirname $0` > /dev/null
trap __EXIT EXIT
tput setaf 7 > /dev/null 2>&1
colorful=$?
function __EXIT() {
popd > /dev/null
}
function printError() {
[[ $colorful -eq 0 ]] && tput setaf 1
>&2 echo "Error: $@"
[[ $colorful -eq 0 ]] && tput setaf 7
}
function printImportantMessage() {
[[ $colorful -eq 0 ]] && tput setaf 3
echo "$@"
[[ $colorful -eq 0 ]] && tput setaf 7
}
function printUsage() {
[[ $colorful -eq 0 ]] && tput setaf 3
>&2 echo "$@"
[[ $colorful -eq 0 ]] && tput setaf 7
}
dirs='bench callback internal mongo mysql redis'
go tool vet -all -shadow=true $dirs
errcheck github.com/edwingeng/wuid/... \
| ag -v '[ \t]*defer'
golint $dirs | ag -v 'receiver name should be a reflection of its identity'