Skip to content

Commit

Permalink
method.Type.NumIn() => method.Type.NumOut()
Browse files Browse the repository at this point in the history
  • Loading branch information
geektutu committed Nov 22, 2020
1 parent 832bc34 commit ffda697
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gee-rpc/doc/geerpc-day3.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ func main() {
for i := 0; i < typ.NumMethod(); i++ {
method := typ.Method(i)
argv := make([]string, 0, method.Type.NumIn())
returns := make([]string, 0, method.Type.NumIn())
// j 从 1 开始,第 0 个入参是 wg 自己。
returns := make([]string, 0, method.Type.NumOut())
// j 从 1 开始,第 0 个入参是 wg 自己。
for j := 1; j < method.Type.NumIn(); j++ {
argv = append(argv, method.Type.In(j).Name())
}
Expand Down Expand Up @@ -494,4 +494,4 @@ start rpc server on [::]:57509
## 附 推荐阅读

- [Go 语言简明教程](https://geektutu.com/post/quick-golang.html)
- [Go 语言笔试面试题](https://geektutu.com/post/qa-golang.html)
- [Go 语言笔试面试题](https://geektutu.com/post/qa-golang.html)

0 comments on commit ffda697

Please sign in to comment.