1
0
mirror of https://github.com/chai2010/advanced-go-programming-book.git synced 2025-05-24 20:52:22 +00:00

Merge pull request #217 from fuwensun/pr4-2-4d

fixed code
This commit is contained in:
chai2010 2018-07-31 21:24:08 +08:00 committed by GitHub
commit eabbf3598c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -285,7 +285,6 @@ func (p *netrpcPlugin) buildServiceSpec(svc *descriptor.ServiceDescriptorProto)
```go ```go
func (p *netrpcPlugin) genServiceCode(svc *descriptor.ServiceDescriptorProto) { func (p *netrpcPlugin) genServiceCode(svc *descriptor.ServiceDescriptorProto) {
for _, svc := range file.Service {
spec := p.buildServiceSpec(svc) spec := p.buildServiceSpec(svc)
var buf bytes.Buffer var buf bytes.Buffer
@ -297,7 +296,6 @@ func (p *netrpcPlugin) genServiceCode(svc *descriptor.ServiceDescriptorProto) {
p.P(buf.String()) p.P(buf.String())
} }
}
``` ```
为了便于维护我们基于Go语言的模板来生成服务代码其中tmplService是服务的模板。 为了便于维护我们基于Go语言的模板来生成服务代码其中tmplService是服务的模板。