tools: golang.org/x/tools/oracle Index | Files | Directories

package oracle

import "golang.org/x/tools/oracle"

Package oracle contains the implementation of the oracle tool whose command-line is provided by golang.org/x/tools/cmd/oracle.

http://golang.org/s/oracle-design http://golang.org/s/oracle-user-manual

Index

Package Files

callees.go callers.go callstack.go definition.go describe.go freevars.go implements.go oracle.go peers.go pointsto.go pos.go referrers.go what.go whicherrs.go

func Run

func Run(q *Query) error

Run runs an oracle query and populates its Fset and Result.

type Query

type Query struct {
    Mode  string         // query mode ("callers", etc)
    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).

    // Populated during Run()
    Fset *token.FileSet
    // contains filtered or unexported fields
}

A Query specifies a single oracle query.

func (*Query) Serial

func (q *Query) Serial() *serial.Result

Serial returns an instance of serial.Result, which implements the {xml,json}.Marshaler interfaces so that query results can be serialized as JSON or XML.

func (*Query) WriteTo

func (q *Query) WriteTo(out io.Writer)

WriteTo writes the oracle query result res to out in a compiler diagnostic format.

Directories

PathSynopsis
serialPackage serial defines the oracle's schema for structured data serialization using JSON, XML, etc.

Package oracle imports 27 packages (graph) and is imported by 4 packages. Updated 2 days ago. Refresh now. Tools for package owners.