You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
455 B
Bash
33 lines
455 B
Bash
#!/bin/bash
|
|
|
|
wd=$(dirname $0)
|
|
project=test
|
|
testDir=$wd/$project
|
|
mkdir -p $testDir
|
|
|
|
cd $testDir
|
|
|
|
# go mod init
|
|
go mod init $project
|
|
|
|
# generate cache code
|
|
goctl model mongo -t User -c --dir cache
|
|
if [ $? -ne 0 ]; then
|
|
exit 1
|
|
fi
|
|
|
|
# generate non-cache code
|
|
goctl model mongo -t User --dir nocache
|
|
if [ $? -ne 0 ]; then
|
|
exit 1
|
|
fi
|
|
|
|
# go mod tidy
|
|
GOPROXY=https://goproxy.cn && go mod tidy
|
|
|
|
# code inspection
|
|
go test -race ./...
|
|
if [ $? -ne 0 ]; then
|
|
echo
|
|
fi
|