Documentation
¶
Overview ¶
Godef prints the source location of definitions in Go programs.
Usage:
godef [-t] [-a] [-A] [-o offset] [-i] [-f file] [-acme] [expr]
Options:
-f file Specifies the source file in which to evaluate expr. -o offset If expr is not given, specifies a location within file, which should be within or adjacent to an identifier or field selector. -t Prints the type of the expression. -a Prints all the public members (fields and methods) of the expression, along with their locations. -A Prints private members as well as public members. -i Reads the source from standard input; file must still be specified to locate other files in the same source package. -acme Reads the offset, file name, and contents from the current acme window.
Expr must be an identifier or a Go expression terminated with a field selector.
Example:
$ cd $GOROOT $ godef -f src/pkg/xml/read.go 'NewParser().Skip' src/pkg/xml/read.go:384:18 $
Directories
¶
Path | Synopsis |
---|---|
go
|
|
ast
Package ast declares the types used to represent syntax trees for Go packages.
|
Package ast declares the types used to represent syntax trees for Go packages. |
parser
A parser for Go source files.
|
A parser for Go source files. |
printer
Package printer implements printing of AST nodes.
|
Package printer implements printing of AST nodes. |
scanner
Package scanner implements a scanner for Go source text.
|
Package scanner implements a scanner for Go source text. |
sym
The sym package provides a way to iterate over and change the symbols in Go source files.
|
The sym package provides a way to iterate over and change the symbols in Go source files. |
token
This package defines constants representing the lexical tokens of the Go programming language and basic operations on tokens (printing, predicates).
|
This package defines constants representing the lexical tokens of the Go programming language and basic operations on tokens (printing, predicates). |
types
Types infers source locations and types from Go expressions.
|
Types infers source locations and types from Go expressions. |
Click to show internal directories.
Click to hide internal directories.