The Wayback Machine - https://web.archive.org/web/20201129222451/https://github.com/lukehoban/go-outline
Skip to content
master
Go to file
Code

Latest commit

Add option to parse imports only and an option to pass file contents
e785568

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time

README.md

Go Outline

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

Installing

go get -u github.com/lukehoban/go-outline

Using

> go-outline -f file.go
[{"label":"proc","type":"package",<...>}]

To parse and return only imports

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

Schema

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"`
}

About

Utility to extract JSON representation of declarations from a Go source file

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.