golang-guru1
Go source code guru
Usage
golang-guru [flag ...]
mode
position
Overview
The mode argument determines the query to perform:
|
show possible targets of selected function call |
|---|---|
|
show possible callers of selected function |
|
show path from callgraph root to selected function |
|
show declaration of selected identifier |
|
describe selected syntax: definition, methods, etc |
|
show free variables of selection |
|
show 'implements' relation for selected type or method |
|
show send/receive corresponding to selected channel op |
|
show variables the selected pointer may point to |
|
show all refs to entity denoted by selected identifier |
|
show basic information about the selected syntax node |
|
show possible values of the selected error variable |
The position argument specifies the filename and byte offset (or range) of the syntax element to query. For example:
foo.go:#123,#128bar.go:#123
The user manual is available here: http://golang.org/s/using-guru
Options
-
-cpuprofile -
Write CPU profile to file.
-
-format format -
Output format:
plainAn editor-friendly format in which every line of output is of the form "pos: text", where pos is "-" if unknown. This is the default.jsonStructured data in JSON syntax.xmlStructured data in XML syntax.
-
-modified -
Read archive of modified files from standard input.
Files in this archive will be used in preference to those in the file system. In this way, a text editor may supply guru with the contents of its unsaved buffers. Each archive entry consists of the file name, a newline, the decimal file size, another newline, and the contents of the file.
-
-ptalog file -
Write points-to analysis log to file.
-
-reflect -
Analyze reflection soundly (slow).
-
-scope packages -
Comma-separated list of packages the analysis should be limited to. Its value is a comma-separated list of patterns of these forms:
golang.org/x/tools/cmd/guru # a single packagegolang.org/x/tools/... # all packages beneath dir... # the entire workspace.A pattern preceded by '-' is negative, so the scopeencoding/...,-encoding/xmlmatches all encoding packages except encoding/xml.
-
-tags build_tags -
A list of build tags to consider satisfied during the build. For more information about build tags, see the description of build constraints in the documentation for the go/build package (default <tagsFlag>).
Examples
Describe the syntax at offset 530 in this file (an import spec):
golang-guru describe src/golang.org/x/tools/cmd/guru/main.go:#530
Releases
Unchanged in 4 releases since Debian 9 (Stretch).