types

package
v0.0.0-...-b76ad68 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2015 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &command.Command{
	Run:       runTypes,
	UsageLine: "types",
	Short:     "golang type util",
	Long:      `golang type util`,
}
View Source
var ObjKindName = []string{"none", "package",
	"type", "interface", "struct",
	"const", "var", "field",
	"func", "method",
	"label", "builtin", "nil"}

Functions

func IsSameObject

func IsSameObject(a, b types.Object) bool

func IsSamePkg

func IsSamePkg(a, b *types.Package) bool

Types

type FileCursor

type FileCursor struct {
	// contains filtered or unexported fields
}

type ObjKind

type ObjKind int
const (
	ObjNone ObjKind = iota
	ObjPkgName
	ObjTypeName
	ObjInterface
	ObjStruct
	ObjConst
	ObjVar
	ObjField
	ObjFunc
	ObjMethod
	ObjLabel
	ObjBuiltin
	ObjNil
)

func (ObjKind) String

func (k ObjKind) String() string

type PkgConfig

type PkgConfig struct {
	IgnoreFuncBodies bool
	AllowBinary      bool
	WithTestFiles    bool
	Cursor           *FileCursor
	Pkg              *types.Package
	XPkg             *types.Package
	Info             *types.Info
	XInfo            *types.Info
	Files            map[string]*ast.File
	TestFiles        map[string]*ast.File
	XTestFiles       map[string]*ast.File
}

type PkgWalker

type PkgWalker struct {
	// contains filtered or unexported fields
}

func NewPkgWalker

func NewPkgWalker(context *build.Context) *PkgWalker

func (*PkgWalker) CheckIsImport

func (w *PkgWalker) CheckIsImport(cursor *FileCursor) *ast.ImportSpec

func (*PkgWalker) Import

func (w *PkgWalker) Import(parentDir string, name string, conf *PkgConfig) (pkg *types.Package, err error)

func (*PkgWalker) LookupCursor

func (w *PkgWalker) LookupCursor(pkg *types.Package, conf *PkgConfig, cursor *FileCursor)

func (*PkgWalker) LookupImport

func (w *PkgWalker) LookupImport(pkg *types.Package, pkgInfo *types.Info, cursor *FileCursor, is *ast.ImportSpec)

func (*PkgWalker) LookupObjects

func (w *PkgWalker) LookupObjects(conf *PkgConfig, cursor *FileCursor)

func (*PkgWalker) LookupStructFromField

func (w *PkgWalker) LookupStructFromField(info *types.Info, cursorPkg *types.Package, cursorObj types.Object, cursorPos token.Pos) types.Object

Jump to

Keyboard shortcuts

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