Documentation ¶ Overview ¶ Package codegen 简单的代码生成工具 Index ¶ func Dump(path string, content []byte, mode fs.FileMode) error func DumpFromTemplate(path, tpl string, data any, mode fs.FileMode) error func DumpFromTemplateFile(path string, tplFile string, data any, mode fs.FileMode) error func GoDefine(t reflect.Type) string Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func Dump ¶ func Dump(path string, content []byte, mode fs.FileMode) error Dump 格式化并输出 Go 源码到 path func DumpFromTemplate ¶ func DumpFromTemplate(path, tpl string, data any, mode fs.FileMode) error DumpFromTemplate 根据模板内容生成代码 func DumpFromTemplateFile ¶ func DumpFromTemplateFile(path string, tplFile string, data any, mode fs.FileMode) error DumpFromTemplateFile 根据 tplFile 指向的模板内容生成代码 func GoDefine ¶ added in v0.12.0 func GoDefine(t reflect.Type) string GoDefine 返回对象 v 在 Go 源码中的定义方式 Types ¶ This section is empty. Source Files ¶ View all Source files codegen.goobject.go Click to show internal directories. Click to hide internal directories.