Skip to content

Commit

Permalink
f*k generate code format
Browse files Browse the repository at this point in the history
  • Loading branch information
alimy committed Aug 19, 2023
1 parent 397ca28 commit f2f89f0
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 16 deletions.
7 changes: 1 addition & 6 deletions examples/auto/ac/yesql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/auto/bc/yesql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions examples/auto/cc/yesql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/auto/yesql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/alimy/yesql/examples
go 1.18

require (
github.com/alimy/yesql v1.8.2
github.com/alimy/yesql v1.8.4
github.com/bitbus/sqlx v1.6.0
)

Expand Down
4 changes: 2 additions & 2 deletions template/sql.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type {{ naming $scope }} struct {

{{if .DefaultQueryMapNotEmpty}}
func Build{{ .DefaultStructName }}(p yesql.PrepareBuilder{{if .DefaultQueryMap.IsStmtQueryNotEmpty }}, ctx ...context.Context{{end}}) (obj *{{ .DefaultStructName }}, err error) {
{{if .DefaultQueryMap.IsStmtQueryNotEmpty -}}
{{- if .DefaultQueryMap.IsStmtQueryNotEmpty -}}
var c context.Context
if len(ctx) > 0 && ctx[0] != nil {
c = ctx[0]
Expand All @@ -53,7 +53,7 @@ func Build{{ .DefaultStructName }}(p yesql.PrepareBuilder{{if .DefaultQueryMap.I
}{{end}}
{{range $scope, $queryMap := .ScopeQuery }}
func Build{{ naming $scope }}(p yesql.PrepareBuilder{{if $queryMap.IsStmtQueryNotEmpty }}, ctx ...context.Context{{end}}) (obj *{{ naming $scope }}, err error) {
{{if $queryMap.IsStmtQueryNotEmpty -}}
{{- if $queryMap.IsStmtQueryNotEmpty -}}
var c context.Context
if len(ctx) > 0 && ctx[0] != nil {
c = ctx[0]
Expand Down
4 changes: 2 additions & 2 deletions template/sqlx.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ type {{ naming $scope }} struct {

{{if .DefaultQueryMapNotEmpty}}
func Build{{ .DefaultStructName }}(p PreparexBuilder{{if .DefaultQueryMap.IsStmtQueryNotEmpty }}, ctx ...context.Context{{end}}) (obj *{{ .DefaultStructName }}, err error) {
{{if .DefaultQueryMap.IsStmtQueryNotEmpty -}}
{{- if .DefaultQueryMap.IsStmtQueryNotEmpty -}}
var c context.Context
if len(ctx) > 0 && ctx[0] != nil {
c = ctx[0]
Expand All @@ -81,7 +81,7 @@ func Build{{ .DefaultStructName }}(p PreparexBuilder{{if .DefaultQueryMap.IsStmt
}{{end}}
{{range $scope, $queryMap := .ScopeQuery }}
func Build{{ naming $scope }}(p PreparexBuilder{{if $queryMap.IsStmtQueryNotEmpty }}, ctx ...context.Context{{end}}) (obj *{{ naming $scope }}, err error) {
{{if $queryMap.IsStmtQueryNotEmpty -}}
{{- if $queryMap.IsStmtQueryNotEmpty -}}
var c context.Context
if len(ctx) > 0 && ctx[0] != nil {
c = ctx[0]
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package yesql

var Version = "v1.8.3"
var Version = "v1.8.4"

0 comments on commit f2f89f0

Please sign in to comment.