Skip to content
/ gofind Public

gofind searches through Go source code by types.

Notifications You must be signed in to change notification settings

motemen/gofind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 

Repository files navigation

gofind

gofind is a comamnd that searches through Go source code by types.

Usage

gofind [-p] [-s] [-q] <pkg>.<name>[.<sel>] <pkg>...

Example

% gofind encoding/json.Encoder.Encode $(go list golang.org/x/...)
handlers.go:145:        json.NewEncoder(w).Encode(resp)
socket.go:125:                  if err := enc.Encode(m); err != nil {

Description

gofind searches through Go source code by given expression, using type information. It finds code entities with the type of given expression:

  • Variable definitions/occurrences
  • Struct fields (with )
  • Methods (with )

Installation

go get -u github.com/motemen/gofind/cmd/gofind

TODO

  • Find return types
  • provide filename-only option like "grep -l"
  • eg. "error" in universe scope
  • print for each package?

Author

motemen https://motemen.github.io/

About

gofind searches through Go source code by types.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages