fix(goctl): fix redundant import (#2551)

This commit is contained in:
anqiansong
2022-10-25 06:58:51 +08:00
committed by GitHub
parent ce73b9a85c
commit 9504d30049
6 changed files with 24 additions and 16 deletions

View File

@@ -9,6 +9,7 @@ const (
"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/cache"
"github.com/zeromicro/go-zero/core/stores/sqlc"
@@ -24,6 +25,7 @@ const (
"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"

View File

@@ -10,16 +10,12 @@ import (
const ModelCustom = `package {{.pkg}}
{{if .withCache}}
import (
"github.com/lib/pq"
"github.com/zeromicro/go-zero/core/stores/cache"
"github.com/zeromicro/go-zero/core/stores/sqlx"
)
{{else}}
import (
"github.com/lib/pq"
"github.com/zeromicro/go-zero/core/stores/sqlx"
)
import "github.com/zeromicro/go-zero/core/stores/sqlx"
{{end}}
var _ {{.upperStartCamelObject}}Model = (*custom{{.upperStartCamelObject}}Model)(nil)