guru

package
v0.0.0-...-c67744c Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: Unlicense Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const HasAlias = true

Variables

This section is empty.

Functions

This section is empty.

Types

type Guru

type Guru struct {
	GOROOT string
	GOPATH string
}

func (Guru) Describe

func (g Guru) Describe(filepath string, position int) (QueryResult, error)

type Query

type Query struct {
	Pos   string         // query position
	Build *build.Context // package loading configuration

	// pointer analysis options
	Scope      []string  // main packages in (*loader.Config).FromArgs syntax
	PTALog     io.Writer // (optional) pointer-analysis log file
	Reflection bool      // model reflection soundly (currently slow).

	// result-printing function, safe for concurrent use
	Output func(*token.FileSet, QueryResult)
}

A Query specifies a single guru query.

type QueryResult

type QueryResult interface {
	// JSON returns the QueryResult in JSON form.
	JSON(fset *token.FileSet) []byte

	// PrintPlain prints the QueryResult in plain text form.
	// The implementation calls printfFunc to print each line of output.
	PrintPlain(printf printfFunc)
}

A QueryResult is an item of output. Each query produces a stream of query results, calling Query.Output for each one.

Jump to

Keyboard shortcuts

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