加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

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

发布时间:2020-12-16 18:15:45 所属栏目:大数据 来源:网络整理
导读:阅读go项目源码时,不方便知道interface有哪些struct实现,很不方便。 list-interfaces这个工具,用来分析go项目源码,帮你快速找出interface有哪些struct实现。 list-interfaces使用 list-interfaces --codedir /appdev/gopath/src/github.com/contiv/netpl

阅读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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读