parser

package
v0.0.0-...-62399c0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {

	// If true, include *_test.go
	IncludeTestFiles bool
	// contains filtered or unexported fields
}

Builder lets you add all the go files in all the packages that you care about, then constructs the type source data.

func New

func New() *Builder

New constructs a new builder.

func (*Builder) AddBuildTags

func (b *Builder) AddBuildTags(tags ...string)

AddBuildTags adds the specified build tags to the parse context.

func (*Builder) AddDir

func (b *Builder) AddDir(dir string) error

AddDir adds an entire directory, scanning it for go files. 'dir' should have a single go package in it. GOPATH, GOROOT, and the location of your go binary (`which go`) will all be searched if dir doesn't literally resolve.

func (*Builder) AddDirRecursive

func (b *Builder) AddDirRecursive(dir string) error

AddDirRecursive is just like AddDir, but it also recursively adds subdirectories; it returns an error only if the path couldn't be resolved; any directories recursed into without go source are ignored.

func (*Builder) FindTypes

func (b *Builder) FindTypes() (types.Universe, error)

FindTypes finalizes the package imports, and searches through all the packages for types.

func (*Builder) SetDebugLevel

func (b *Builder) SetDebugLevel()

Directories

Path Synopsis
testpkg
a1
a1 testdata.a1
a1 testdata.a1
a2

Jump to

Keyboard shortcuts

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