Add grpc_validator

This commit is contained in:
Nex
2020-06-16 15:12:53 +08:00
parent c2228d5601
commit 59f3e6a248
2 changed files with 9 additions and 2 deletions

View File

@@ -36,12 +36,17 @@ do
if [ $? -ne 0 ];then
echo "missing plugin: $plugin" && exit
fi
vplugin=protoc-gen-govalidators
which $vplugin > /dev/null
if [ $? -ne 0 ];then
echo "missing plugin: $vplugin" && exit
fi
out="$gen_dir/go"
if [ ! -d $out ]; then
mkdir -p $out
fi
echo "Generating Go code"
$exec --go_out=plugins=grpc:$out $pb_files $async_tag
$exec --go_out=plugins=grpc:$out --govalidators_out=$out $pb_files $async_tag
fi
if [ $aug == "gohttp" ]; then
plugin=protoc-gen-grpc-gateway