| 123456789101112131415161718192021222324252627282930313233343536373839 | #!/bin/bashFAIL=0function test_package {  DIR="$1"  DEP=$(go list -f '{{ join .Deps "\n" }}' $DIR | grep v2ray | tr '\n' ',')  DEP=${DEP}$DIR  go test -coverprofile=coversingle.out -coverpkg=$DEP $DIR || FAIL=1  if [ -f coversingle.out ]; then    cat coversingle.out | grep -v "mode: set" >> coverall.out    rm coversingle.out  fi}pushd $GOPATH/src/touch coverall.outfor DIR in $(find github.com/v2ray/v2ray-core -type d -not -path "*.git*"); do  TEST_FILES=($DIR/*_test.go)  if [ -f ${TEST_FILES[0]} ]; then    test_package $DIR  fidonecat coverall.out | sort -t: -k1 | uniq -u > coverallsorted.outecho "mode: set" | cat - coverallsorted.out > coverall.outrm coverallsorted.outif [ "$FAIL" -eq 0 ]; then  $HOME/gopath/bin/goveralls -v -coverprofile=coverall.out -service=travis-ci -repotoken $COVERALLS_TOKENfirm -f coverall.outpopdexit $FAIL
 |