cd proto protoc -I ./ *.proto --go_out=plugins=grpc:. if [ $? -ne 0 ];then echo "生成go代码失败!" else cd ../golang rm -rf *.go mv ../proto/*.go . sed -i '' 's/,omitempty//g' *.go echo "生成go代码成功!" fi