Documentation ¶
Index ¶
- Variables
- func IsSameObject(a, b types.Object) bool
- func IsSamePkg(a, b *types.Package) bool
- type ExprSlice
- type FileCursor
- type FilesCheck
- type FindMode
- type Importer
- type ObjKind
- type ObjectInfo
- type PkgConfig
- type PkgWalker
- func (p *PkgWalker) Check(name string, conf *PkgConfig, cusror *FileCursor) (pkg *types.Package, outconf *PkgConfig, err error)
- func (w *PkgWalker) CheckIsBasic(cursor *FileCursor, pkgInfo *types.Info) *ast.BasicLit
- func (w *PkgWalker) CheckIsImport(cursor *FileCursor) *ast.ImportSpec
- func (w *PkgWalker) CheckIsName(cursor *FileCursor) *ast.Ident
- func (w *PkgWalker) CheckIsObject(cursor *FileCursor, pkgInfo *types.Info) (cursorObj types.Object, cursorSelection *types.Selection)
- func (w *PkgWalker) CheckObjectInfo(cursorObj types.Object, cursorSelection *types.Selection, kind ObjKind, ...) *ObjectInfo
- func (w *PkgWalker) Import(parentDir string, name string, conf *PkgConfig, cursor *FileCursor) (pkg *types.Package, outconf *PkgConfig, err error)
- func (w *PkgWalker) ImportHelper(parentDir string, name string, import_path string, conf *PkgConfig, ...) (pkg *types.Package, outconf *PkgConfig, err error)
- func (w *PkgWalker) LookupByText(pkgInfo *types.Info, text string) types.Object
- func (w *PkgWalker) LookupCursor(pkg *types.Package, conf *PkgConfig, cursor *FileCursor) error
- func (w *PkgWalker) LookupImport(pkg *types.Package, pkgInfo *types.Info, cursor *FileCursor, ...) error
- func (w *PkgWalker) LookupName(pkg *types.Package, conf *PkgConfig, cursor *FileCursor, nm *ast.Ident) error
- func (w *PkgWalker) LookupObjects(conf *PkgConfig, cursor *FileCursor) error
- func (w *PkgWalker) LookupStructFromField(info *types.Info, cursorPkg *types.Package, cursorObj types.Object, ...) types.Object
- func (w *PkgWalker) SetFindMode(mode *FindMode)
- func (w *PkgWalker) SetOutput(stdout io.Writer, stderr io.Writer)
- func (w *PkgWalker) UpdateSourceData(filename string, data []byte, cleanAllSourceCache bool)
- type SourceData
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", "package",
"type", "interface", "struct",
"const", "var", "field",
"func", "method",
"label", "builtin", "nil",
"implicit", "unknown", "comment"}
Functions ¶
func IsSameObject ¶
Types ¶
type FileCursor ¶
type FileCursor struct {
// contains filtered or unexported fields
}
func NewFileCursor ¶
func NewFileCursor(src []byte, dir string, filename string, pos int) *FileCursor
func (*FileCursor) SetText ¶
func (f *FileCursor) SetText(text string)
type FilesCheck ¶
type FindMode ¶
type ObjectInfo ¶ added in v1.1.0
type ObjectInfo struct {
// contains filtered or unexported fields
}
type PkgConfig ¶
type PkgConfig struct { Pkg *types.Package XPkg *types.Package Info *types.Info XInfo *types.Info Bpkg *build.Package Files map[string]*ast.File XTestFiles map[string]*ast.File IgnoreFuncBodies bool AllowBinary bool WithTestFiles bool }
func DefaultPkgConfig ¶
func DefaultPkgConfig() *PkgConfig
func NewPkgConfig ¶
type PkgWalker ¶
type PkgWalker struct { FileSet *token.FileSet Context *build.Context ParsedFileCache map[string]*ast.File ParsedFileModTime map[string]int64 Imported map[string]*types.Package // packages already imported ImportedConfig map[string]*PkgConfig ImportedFilesCheck map[string]*FilesCheck ModPkg *fastmod.Package // contains filtered or unexported fields }
func NewPkgWalker ¶
func (*PkgWalker) CheckIsBasic ¶ added in v1.1.0
func (*PkgWalker) CheckIsImport ¶
func (w *PkgWalker) CheckIsImport(cursor *FileCursor) *ast.ImportSpec
func (*PkgWalker) CheckIsName ¶
func (w *PkgWalker) CheckIsName(cursor *FileCursor) *ast.Ident
func (*PkgWalker) CheckIsObject ¶ added in v1.1.0
func (*PkgWalker) CheckObjectInfo ¶ added in v1.1.0
func (*PkgWalker) ImportHelper ¶
func (*PkgWalker) LookupByText ¶
func (*PkgWalker) LookupCursor ¶
func (*PkgWalker) LookupImport ¶
func (w *PkgWalker) LookupImport(pkg *types.Package, pkgInfo *types.Info, cursor *FileCursor, is *ast.ImportSpec) error
func (*PkgWalker) LookupName ¶
func (*PkgWalker) LookupObjects ¶
func (w *PkgWalker) LookupObjects(conf *PkgConfig, cursor *FileCursor) error
func (*PkgWalker) LookupStructFromField ¶
func (*PkgWalker) SetFindMode ¶
type SourceData ¶
type SourceData struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.