Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindConstByTypeName ¶
FindConstByTypeName find all const in *ast.File
Parameter TypeName : find the const value
Return []*ast.ValueSpec : return all found const value
Example type Type byte
const (
TypeCA Type = iota TypeCB NotTypeCA = 2 NotTypeCB = iota TypeCC = Type(iota) TypeCD NotTypeCC = int(iota) NotTypeCD = byte(7) TypeCE Type = 8 TypeCF Type = 9
) */
func FindFuncByName ¶
FindFuncByName find function in *ast.File
Parameter ReceiverType: pass the receiver type if there is a receiver or empty string FuncName : try to find the function name
Return *ast.FuncDecl: return the found the function or nil bool : return true if found function or false
Example function without receiver: func F() {} FindFuncByName(f,"","F") function with receiver: type idea struct{} func (idea) F(){} FindFuncByName(f,"idea","F") */
func FindStructByName ¶
FindStructByName find struct in *ast.File
Parameter StructName: try to find the struct name
Return *ast.TypeSpec : struct declaration *ast.StructType: struct content declaration bool : is found struct
Example func F() {} FindStructByName(f,"F")
Types ¶
This section is empty.