Files
go-zero/tools/goctl/util/head.go
2022-04-01 14:48:45 +08:00

16 lines
470 B
Go

package util
// DoNotEditHead added to the beginning of a file to prompt the user not to edit
var DoNotEditHead = "// Code generated by goctl. DO NOT EDIT!"
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()
}