Files
go-zero/tools/goctl/model/sql/template/import.go

36 lines
900 B
Go
Raw Normal View History

package template
2020-07-29 17:11:41 +08:00
2022-04-01 22:19:52 +08:00
const (
2022-11-04 21:55:17 +08:00
// Imports defines an import template for model in cache case
Imports = `import (
"context"
"database/sql"
"fmt"
2020-07-29 17:11:41 +08:00
"strings"
{{if .time}}"time"{{end}}
2020-07-29 17:11:41 +08:00
{{if .containsPQ}}"github.com/lib/pq"{{end}}
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/cache"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
2020-07-29 17:11:41 +08:00
)
`
2022-11-04 21:55:17 +08:00
// ImportsNoCache defines an import template for model in normal case
ImportsNoCache = `import (
"context"
"database/sql"
"fmt"
"strings"
{{if .time}}"time"{{end}}
{{if .containsPQ}}"github.com/lib/pq"{{end}}
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
`
)