|GOLANG-GURU(1)||General Commands Manual||GOLANG-GURU(1)|
NAME¶golang-guru - Go source code guru
SYNOPSIS¶golang-guru [ flag ... ] mode position
DESCRIPTION¶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:
The user manual is available here: http://golang.org/s/using-guru
- Write CPU profile to file.
- -format format
- Output format:
plain An editor-friendly format in which every line of output is of the form "pos: text", where pos is "-" if unknown. This is the default.
json Structured data in JSON syntax.
xml Structured data in XML syntax.
- 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.
- 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 package golang.org/x/tools/... # all packages beneath dir ... # the entire workspace.matches all encoding packages except encoding/xml.
A pattern preceded by '-' is negative, so the scope
- -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
AUTHOR¶This manual page was written by Michael Stapelberg <email@example.com>, for the Debian project (and may be used by others).