1
0
mirror of https://github.com/chai2010/advanced-go-programming-book.git synced 2025-05-27 23:12:20 +00:00
This commit is contained in:
Xargin 2018-05-28 17:20:16 +08:00
parent b271ea6c98
commit bb5e132633

View File

@ -117,7 +117,7 @@ type FeatureSetParams struct {
当然这种思路并不是唯一选择,我们还可以通过解析 thrift 的 IDL生成一套 http 接口的 struct。如果你选择这么做那整个流程就变成了这样
![code gen](../images/ch6-08-code-gen.png)
![code gen](../images/ch6-08-code-gen-2.png)
看起来比之前的图顺畅一点,不过如果你选择了这么做,你需要自行对 thrift 的 IDL 进行解析,也就是相当于可能要手写一个 thrift 的 IDL 的 parser虽然现在有 antlr 或者 peg 能帮你简化这些 parser 的书写工作,但在“解析”的这一步我们不希望引入太多的工作量,所以量力而行即可。