new.go 383 B

1234567891011
  1. package template
  2. // New defines an template for creating model instance
  3. var New = `
  4. func New{{.upperStartCamelObject}}Model(conn sqlx.SqlConn{{if .withCache}}, c cache.CacheConf{{end}}) {{.upperStartCamelObject}}Model {
  5. return &default{{.upperStartCamelObject}}Model{
  6. {{if .withCache}}CachedConn: sqlc.NewConn(conn, c){{else}}conn:conn{{end}},
  7. table: "{{.table}}",
  8. }
  9. }
  10. `