1
0
mirror of https://github.com/chai2010/advanced-go-programming-book.git synced 2025-05-24 12:32:21 +00:00

ch4-02: 修复代码错误

This commit is contained in:
chai2010 2018-07-15 20:44:40 +08:00
parent c719a56ad4
commit 8f0153dc9a
2 changed files with 2 additions and 2 deletions

View File

@ -354,7 +354,7 @@ type {{.ServiceName}}Interface interface {
{{- end}}
}
func Register{{.ServiceName}}(srv *rpc.Server, x {{.ServiceName}}) error {
func Register{{.ServiceName}}(srv *rpc.Server, x {{.ServiceName}}Interface) error {
if err := srv.RegisterName("{{.ServiceName}}", x); err != nil {
return err
}

View File

@ -87,7 +87,7 @@ type {{.ServiceName}}Interface interface {
{{- end}}
}
func Register{{.ServiceName}}(srv *rpc.Server, x {{.ServiceName}}) error {
func Register{{.ServiceName}}(srv *rpc.Server, x {{.ServiceName}}Interface) error {
if err := srv.RegisterName("{{.ServiceName}}", x); err != nil {
return err
}