zeromicro / go-zero

A cloud-native Go microservices framework with cli tool for productivity.
https://go-zero.dev
MIT License
29.16k stars 3.95k forks source link

Using protoc to generate gateway grpc's pd file with garbled characters #4318

Open haioa opened 2 months ago

haioa commented 2 months ago

Describe the bug A clear and concise description of what the bug is. Using protoc to generate gateway grpc's pd file with garbled characters, Specific version:

PS D:\project\haiqiu-zero-admin> protoc --descriptor_set_out=gateway/hello.pb hello.proto
PS D:\project\haiqiu-zero-admin> goctl env
GOCTL_OS=windows
GOCTL_ARCH=amd64
GOCTL_HOME=C:\Users\haiqiu\.goctl
GOCTL_DEBUG=False
GOCTL_CACHE=C:\Users\haiqiu\.goctl\cache
GOCTL_EXPERIMENTAL=on
GOCTL_VERSION=1.7.0
PROTOC_VERSION=3.19.4
PROTOC_GEN_GO_VERSION=v1.34.2
PROTO_GEN_GO_GRPC_VERSION=1.5.1

Creating according to the tutorial provided on the official website resulted in garbled characters https://go-zero.dev/docs/tutorials/gateway/grpc image image

To Reproduce Steps to reproduce the behavior, if applicable:

  1. The code is

    
    syntax = "proto3";

package hello; option go_package = "./hello"; message Request { } message Response { string msg = 1; } service Hello { rpc Ping(Request) returns(Response); }


2. The error is

‚ hello.protohello"
Request" Response msg ( Rmsg20 Hello' Ping.hello.Request.hello.ResponseB Z./hellobproto3



**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environments (please complete the following information):**
 - OS: [e.g. Linux]
 - go-zero version [e.g. 1.2.1]
 - goctl version [e.g. 1.2.1, optional]

**More description**
Add any other context about the problem here.
kesonan commented 2 months ago

Descriptor provides a series of functions and types to provide reflection capabilities for grpc, so the resulting product is not pg.go, but descriptor