Documentation ¶
Index ¶
- func BuildFunctionCallExpr(pkgName string, funcName string, args []ast.Expr) *ast.CallExpr
- func GetAllFiles(dir string) ([]string, error)
- func GetCurrentFileAbsPath() (string, bool)
- func GetProjectAbsPath() (path string, ok error)
- func ParseFile(filePath string, f func(n ast.Node) bool) (err error)
- type File
- func (_this *File) GetAbsPath() (string, error)
- func (_this *File) GetDirAllFiles() ([]string, error)
- func (_this *File) GetDirPath() (string, error)
- func (_this *File) GetFileExt() string
- func (_this *File) GetFileName() string
- func (_this *File) Inspect(f func(n ast.Node) bool) (err error)
- func (_this *File) InspectMethods(f func(funcDecl *ast.FuncDecl) bool) (err error)
- func (_this *File) IsAbs() bool
- func (_this *File) IsDir() (bool, error)
- func (_this *File) IsFile() (bool, error)
- func (_this *File) Open() (*os.File, error)
- func (_this *File) OpenFile(flag int, perm os.FileMode) (*os.File, error)
- func (_this *File) OpenFileFunc(flag int, perm os.FileMode, action func(*os.File) error) (err error)
- func (_this *File) OpenFunc(action func(*os.File) error) (err error)
- func (_this *File) ParseFile() (f *ast.File, err error)
- func (_this *File) WalkDir(f func(path string, info os.FileInfo, err error) error) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildFunctionCallExpr ¶
BuildFunctionCallExpr 构建函数调用表达式
func GetCurrentFileAbsPath ¶
GetCurrentFileAbsPath returns the current file absolute path
func GetProjectAbsPath ¶
GetProjectAbsPath returns the project absolute path
Types ¶
type File ¶
type File struct {
Path string // package path
}
func (*File) GetAbsPath ¶
GetAbsPath returns the absolute path
func (*File) GetDirAllFiles ¶
GetDirAllFiles returns all the files in the fileDirPath
func (*File) GetDirPath ¶
GetDirPath returns the dir absolute path
func (*File) GetFileExt ¶
GetFileExt returns the absolute path
func (*File) GetFileName ¶
GetFileName returns the absolute path
func (*File) InspectMethods ¶
InspectMethods inspect methods
func (*File) OpenFileFunc ¶
func (_this *File) OpenFileFunc(flag int, perm os.FileMode, action func(*os.File) error) (err error)
OpenFileFunc use the os.OpenFile function to open the file
Click to show internal directories.
Click to hide internal directories.