From 9a671f6059791206b20cd3f1fa1f437c87b7b8ea Mon Sep 17 00:00:00 2001 From: kesonan Date: Sat, 6 Jan 2024 22:45:46 +0800 Subject: [PATCH] fix #3825 (#3828) --- tools/goctl/internal/version/version.go | 2 +- tools/goctl/model/sql/template/tpl/find-one-by-field.tpl | 2 +- tools/goctl/model/sql/template/tpl/import-no-cache.tpl | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/goctl/internal/version/version.go b/tools/goctl/internal/version/version.go index 6ec409b0..9554de45 100644 --- a/tools/goctl/internal/version/version.go +++ b/tools/goctl/internal/version/version.go @@ -6,7 +6,7 @@ import ( ) // BuildVersion is the version of goctl. -const BuildVersion = "1.6.1" +const BuildVersion = "1.6.2" var tag = map[string]int{"pre-alpha": 0, "alpha": 1, "pre-bata": 2, "beta": 3, "released": 4, "": 5} diff --git a/tools/goctl/model/sql/template/tpl/find-one-by-field.tpl b/tools/goctl/model/sql/template/tpl/find-one-by-field.tpl index 390fb01c..dfcf9231 100644 --- a/tools/goctl/model/sql/template/tpl/find-one-by-field.tpl +++ b/tools/goctl/model/sql/template/tpl/find-one-by-field.tpl @@ -22,7 +22,7 @@ func (m *default{{.upperStartCamelObject}}Model) FindOneBy{{.upperField}}(ctx co switch err { case nil: return &resp, nil - case sqlc.ErrNotFound: + case sqlx.ErrNotFound: return nil, ErrNotFound default: return nil, err diff --git a/tools/goctl/model/sql/template/tpl/import-no-cache.tpl b/tools/goctl/model/sql/template/tpl/import-no-cache.tpl index d99564e1..ba9c6b4d 100644 --- a/tools/goctl/model/sql/template/tpl/import-no-cache.tpl +++ b/tools/goctl/model/sql/template/tpl/import-no-cache.tpl @@ -7,7 +7,6 @@ import ( {{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" )