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

 

posted @ 2018-07-25 15:27  MrBlue  阅读(1420)  评论(0编辑  收藏  举报