阅读go项目源码,解决无法快速找到interface有哪些struct实现问题

阅读go项目源码时,不方便知道interface有哪些struct实现,很不方便。

list-interfaces这个工具,用来分析go项目源码,帮你快速找出interface有哪些struct实现。

list-interfaces使用

list-interfaces --codedir /appdev/gopath/src/github.com/contiv/netplugin \
--gopath /appdev/gopath \
--outputfile  /tmp/result

参数说明
--codedir 要分析的代码目录
--gopath GOPATH环境变量目录
--outputfile 分析结果保存到该文件

输出样例:

interface item 在文件/appdev/gopath/src/github.com/contiv/netplugin/vendor/google.golang.org/grpc/transport/transport.go中
有2个struct实现了接口
struct windowUpdate 在文件/appdev/gopath/src/github.com/contiv/netplugin/vendor/google.golang.org/grpc/transport/control.go中
struct settings 在文件/appdev/gopath/src/github.com/contiv/netplugin/vendor/google.golang.org/grpc/transport/control.go中

项目源码仓库

https://git.oschina.net/jscode/list-interfaces

下载地址

如果你的系统是fedora25 x86_64或兼容的系统,可以下载已编译好的二进制包。

http://oog2gj1e8.bkt.clouddn.com/list-interfaces

转载于:https://my.oschina.net/u/1263909/blog/880151

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值