生活处处是难题,auth.pb.gw.go编译不过
老师您好,我运行genProto.sh后,只有auth.pb.gw.go没有生成
这是我的代码:
PROTO_PATH=./auth/api GO_OUT_PATH=./auth/api/gen/v1 mkdir -p $GO_OUT_PATH protoc -I=$PROTO_PATH --go_out=plugins=grpc,paths=source_relative:$GO_OUT_PATH auth.proto protoc -I=$PROTO_PATH --grpc-gateway_out=paths=source_relative,grpc_api_configuration=$PROTO_PATH/auth.yaml:$GO_OUT_PATH auth.proto PBTS_BIN_DIR=../wx/miniprogram/node_modules/.bin PBTS_OUT_DIR=../wx/miniprogram/service/proto_gen/auth mkdir -p $PBTS_OUT_DIR $PBTS_BIN_DIR/pbjs -t static -w es6 $PROTO_PATH/auth.proto --no-create --no-encode --no-decode --no-verify --no-delimited --force-number -o $PBTS_OUT_DIR/auth_pb_tmp.js echo 'import * as $protobuf from "protobufjs";\n' > $PBTS_OUT_DIR/auth_pb.js cat $PBTS_OUT_DIR/auth_pb_tmp.js >> $PBTS_OUT_DIR/auth_pb.js rm $PBTS_OUT_DIR/auth_pb_tmp.js $PBTS_BIN_DIR/pbts -o $PBTS_OUT_DIR/auth_pb.d.ts $PBTS_OUT_DIR/auth_pb.js
我在终端运行后的提示是这样的:

后面我有单独运行:
protoc -I=./auth/api --grpc-gateway_out=paths=source_relative,grpc_api_configuration=./auth/api/auth.yaml:./auth/api/gen/v1 auth.proto
同样是这个提示:

”没有匹配选择器的 HTTP 规则“
这个问题也去网上查了,无果
我记得之前弄trip.proto的时候是可以的生成trip.pb,gw.go文件的
23
收起
正在回答
1回答
你单词写错了,你写的是AuthSerivce,yaml匹配的规则是AuthService
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星