mohuishou / protoc-gen-go-gin

从 protobuf 文件中生成使用 gin 的 http rpc 服务 (protobuf to gin code)
108 stars 44 forks source link

为什么不直接把gin.ctx带到service handle中? #7

Open victory460 opened 2 years ago

victory460 commented 2 years ago

https://github.com/mohuishou/protoc-gen-go-gin/blob/1e7cbc8cc172ee721145470c33fe08b01771717c/template.go.tpl#L107-L109

为什么不直接把gin.ctx带到service handle中?gin.ctx拥有很多实用的方法工具

mohuishou commented 2 years ago

不够通用, gin.ctx 不是标准的 context,这个当时考虑需要支持其它协议和框架