go-zero/tools/goctl/util/head.go

13 lines
325 B
Go
Raw Normal View History

package util
2020-08-28 21:22:35 +08:00
var headTemplate = `// Code generated by goctl. DO NOT EDIT!
// Source: {{.source}}`
// GetHead returns a code head string with source filename
func GetHead(source string) string {
buffer, _ := With("head").Parse(headTemplate).Execute(map[string]interface{}{
"source": source,
})
return buffer.String()
}