Documentation ¶
Overview ¶
Command browse is a source code viewer.
Usage ¶
Invocation of the command:
browse [flags] [import-path]
The optional import path argument must be a valid import path. If no argument is provided the command checks if the current working directory is in a subtree rooted at GOPATH/src, in which case it opens the package files in the current directory.
Flags ¶
Options to amend things:
-tags 'white space separated string'
A list of additional 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.
The default tag set includes the Go version tags, like "go1.1" ... "go1.7", according to the version of Go used to build the command, and tags based on runtime.GOOS and runtime GOARCH. The last two tags can be overridden by setting the GOOS and GOARCH environmental variables, respectively.
The additional tags, if any, are added to the default tag set.
Navigation ¶
Keys recognized by the focused window or the application itself.
<PageUp> or CTRL-B Scroll window one page Backwards (upwards) in the buffer. CTRL-D Scroll window half a screen Downwards in the buffer. CTRL-E Scroll window one line downwards in the buffer. Mnemonic: Extra lines. <PageDown> or CTRL-F Scroll window one page Forwards (downwards) in the buffer. <Tab> or CTRL-I Go to newer cursor position in location history list CTRL-U Scroll window half a screen Upwards in the buffer. CTRL-O Go to Older cursor position in location history list CTRL-Q Quit the application. CTRL-W Close the Window. CTRL-Y Scrolls one line upwards in the buffer. <Home> Scroll to the first line. <End> Scroll to the last line.
Screenshot ¶
See https://gitlab.com/cznic/browse/raw/images/browse.png
Known issues ¶
Key bindings and terminal colors are hard coded.
In terminals with no mouse support there's no way to select and follow links to declarations.
Identifiers in certain contexts cannot be resolved to their respective declarations without type information available. Browse does not (yet) type check the loaded packages. The (slower) fallback in such cases depends on the guru tool. To install guru:
go get -u golang.org/x/tools/cmd/guru