完整代码:github.com/cuishuang/g..., 此处仅需要使用gRPC Server,不需要Client部分
切到 helloservice目录执行 go run main/main.go

grpcui
go install github.com/fullstorydev/grpcui/cmd/grpcui@latest
grpcui -plaintext 127.0.0.1:1234

参考调试工具_微服务实战之 Go gRPC 调试工具,在源码中加一行reflection.Register(s)

重新启动Server



grpcurl
grpcui底层其实就是grpcurl
go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest
或 brew install grpcurl
或使用Docker
docker
# Download image
docker pull fullstorydev/grpcurl:latest
# Run the tool
docker run fullstorydev/grpcurl api.grpc.me:443 list
grpcurl -plaintext localhost:端口号 list

不如grpcui直观
Postman


另外类似的工具还有 Evans,BloomRPC (超实用的 gRPC 客户端调试工具)