head.go 325 B

123456789101112
  1. package util
  2. var headTemplate = `// Code generated by goctl. DO NOT EDIT!
  3. // Source: {{.source}}`
  4. // GetHead returns a code head string with source filename
  5. func GetHead(source string) string {
  6. buffer, _ := With("head").Parse(headTemplate).Execute(map[string]interface{}{
  7. "source": source,
  8. })
  9. return buffer.String()
  10. }