Skip to content

nishanths/impl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

impl

wercker status CircleCI

impl is a tool to find implementers of an interface in Go programs.

For example:

$ impl -interface discovery.SwaggerSchemaInterface -path $GOPATH/k8s.io/kubernetes/pkg/client/typed/discovery 
discovery_client.go:82:6: *discovery.DiscoveryClient
discovery_client.go:40:6: discovery.DiscoveryInterface

More options:

$ impl -help
Find the implementers of an interface in go source code.

Examples:
  impl -interface discovery.SwaggerSchemaInterface -path ~/go/src/k8s.io/kubernetes/pkg/client/typed/discovery
  impl -interface datastore.RawInterface -path ./luci/gae/service/datastore -format json 

Flags:
  -concrete-only
    	output concrete types only, by default the output contains both interface and concrete types that implement the specified interface
  -format string
    	output format, should be one of: {plain,json,xml} (default "plain")
  -interface string
    	interface name to find implementing types for, format: packageName.interfaceName
  -path string
    	absolute or relative path to directory or file

The -interface and -path flags are required.

The implementer type and interface type should both reside in the supplied path.

Also see the go oracle for a similar, more machine-friendly tool. Unlike the oracle, impl directly takes the interface name as input instead of filename/byte offsets.

Install

go get -u github.com/nishanths/impl

License

MIT.

About

Find types that implement an interface

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages