command module
v0.0.0-...-9736a4b Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2021 License: MIT Imports: 10 Imported by: 0


Go Outline

Simple utility for extracting a JSON representation of the declarations in a Go source file.


go get -u github.com/ramya-rao-a/go-outline


> go-outline -f file.go

To parse and return only imports

> go-outline -f file.go -imports-only

To parse unsaved file contents, use the -modified flag along with the -f flag and write an archive to stdin.
File in the archive will be preferred over the one on disk.

The archive entry consists of:

  • the file name, followed by a newline
  • the (decimal) file size, followed by a newline
  • the contents of the file
type Declaration struct {
	Label        string        `json:"label"`
	Type         string        `json:"type"`
	ReceiverType string        `json:"receiverType,omitempty"`
	Start        token.Pos     `json:"start"`
	End          token.Pos     `json:"end"`
	Children     []Declaration `json:"children,omitempty"`


The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL