Documentation
¶
Overview ¶
Package module provides the functions to merge the code of two files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseErrorCode ¶
ParseErrorCode parse error code from srcFile and genFile, and merge them.
Types ¶
type CodeAst ¶
type CodeAst struct { FilePath string SrcCode string FileSize int AstInfos []*goast.AstInfo // contains filtered or unexported fields }
CodeAst is the struct for code
func NewCodeAst ¶
func ParseGRPCMethodsTestAndBenchmarkCode ¶
ParseGRPCMethodsTestAndBenchmarkCode parses the source code and generated code of the service file
type RouterCodeAst ¶
type RouterCodeAst struct { FilePath string SrcCode string FileSize int AstInfos []*goast.AstInfo // contains filtered or unexported fields }
RouterCodeAst is the struct for router code
func NewRouterCodeAst ¶
func NewRouterCodeAst(filePath string) (*RouterCodeAst, error)
func ParseRouterCode ¶
func ParseRouterCode(srcFile string, genFile string) (*RouterCodeAst, error)
ParseRouterCode parse router code from source and generated file, and merge them.
func (*RouterCodeAst) CompareExistedMiddlewareFunc ¶
func (a *RouterCodeAst) CompareExistedMiddlewareFunc(genAst *RouterCodeAst) error
CompareExistedMiddlewareFunc compare the existed middlewareFunc in the source code and generated code, and find the non-existed singlePaths
func (*RouterCodeAst) FindNonExistedName ¶
func (a *RouterCodeAst) FindNonExistedName(genAsts []*goast.AstInfo)
FindNonExistedName find non-existed names in the src code
Click to show internal directories.
Click to hide internal directories.