When you look at the source of the Go project, how do you know what interface are implemented

Source: Internet
Author: User
Tags what interface
This is a creation in Article, where the information may have evolved or changed.

When reading the Go Project source code, such as Contiv, it is inconvenient to know what interface are implemented. A tool list-interfaces was developed to analyze the source code of the Go project to find out which struct implementations are interface.

Project Source Repository

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

List-interfaces use

list-interfaces --codedir /appdev/gopath/src/github.com/contiv/netplugin \--gopath /appdev/gopath \--outputfile  /tmp/result参数说明--codedir 要分析的代码目录--gopath GOPATH环境变量目录--outputfile 分析结果保存到该文件

Sample output:

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中

Download Address

If your system is fedora25 x86_64 or a compatible system, you can download the compiled binary package.

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.