mirror of
https://github.com/geektutu/7days-golang.git
synced 2024-04-21 12:32:11 +00:00
method.Type.NumIn() => method.Type.NumOut()
This commit is contained in:
@@ -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())
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user