Golang 代码检查工具

需要先安装 gometalinter工具

#!/bin/bash

#should install
#go get github.com/alecthomas/gometalinter
#gometalinter --install --update

CURDIR="$( cd "$( dirname "$0"  )" && pwd  )"
export GOPATH=$CURDIR/..
echo GOPATH=$GOPATH

dir=($GOPATH/src/logic/... $GOPATH/src/battle/...)
for i in ${dir[@]}
do
    echo checking $i 
    echo ------------------------------------------------------
    gometalinter.exe --disable=gosec --disable=errcheck --disable=golint --disable=gocyclo --exclude=test $i
    #gometalinter.exe --disable=gosec --disable=errcheck --disable=golint --disable=gocyclo --exclude=test --errors $i
    echo ------------------------------------------------------
    echo
done

read -p "press any key to exit" -n 1 -r

猜你喜欢

转载自www.cnblogs.com/mrblue/p/9366197.html