Documentation
¶
Index ¶
- Variables
- type GoFile
- func (f *GoFile) AST() *ast.File
- func (f *GoFile) Bytes() ([]byte, error)
- func (f *GoFile) Dir() string
- func (f *GoFile) FileSet() *token.FileSet
- func (f *GoFile) Fprint(output io.Writer) error
- func (f *GoFile) Name() string
- func (f *GoFile) Path() string
- func (f *GoFile) WriteFile(path string) error
- type GoPackage
Constants ¶
This section is empty.
Variables ¶
View Source
var Config = packages.Config{ Mode: packages.NeedName | packages.NeedSyntax | packages.NeedImports | packages.NeedCompiledGoFiles | packages.NeedFiles | packages.NeedTypes | packages.NeedDeps, Tests: false, BuildFlags: []string{}, }
Config is the config used to load file/packages. Config.Dir is overwritten before loading files.
Functions ¶
This section is empty.
Types ¶
type GoFile ¶
type GoFile struct {
// contains filtered or unexported fields
}
GoFile define a parsed go file.
func File ¶
File parse the file at the given path and return a new *GoFile. Test file (*_test.go) are not supported.
func (*GoFile) FileSet ¶
FileSet return a token.FileSet if the GoFile belong to a GoPackage and nil otherwise.
type GoPackage ¶
type GoPackage struct { Files []*GoFile // contains filtered or unexported fields }
GoPackage define a loaded/parsed go package.
Click to show internal directories.
Click to hide internal directories.