gofind is a comamnd that searches through Go source code by types.
gofind [-p] [-s] [-q] <pkg>.<name>[.<sel>] <pkg>...
% 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 {
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 )
go get -u github.com/motemen/gofind/cmd/gofind
- Find return types
- provide filename-only option like "grep -l"
- eg. "error" in universe scope
- print for each package?
motemen https://motemen.github.io/