From f2f89f042dc5ffacc37246439c821eb731460422 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Sat, 19 Aug 2023 16:38:36 +0800 Subject: [PATCH] f*k generate code format --- examples/auto/ac/yesql.go | 7 +------ examples/auto/bc/yesql.go | 2 +- examples/auto/cc/yesql.go | 3 +-- examples/auto/yesql.go | 2 +- examples/go.mod | 2 +- template/sql.tmpl | 4 ++-- template/sqlx.tmpl | 4 ++-- version.go | 2 +- 8 files changed, 10 insertions(+), 16 deletions(-) diff --git a/examples/auto/ac/yesql.go b/examples/auto/ac/yesql.go index 2b5fa99..2ebf69f 100644 --- a/examples/auto/ac/yesql.go +++ b/examples/auto/ac/yesql.go @@ -1,6 +1,6 @@ // Code generated by Yesql. DO NOT EDIT. // versions: -// - Yesql v1.8.3 +// - Yesql v1.8.4 package ac @@ -125,7 +125,6 @@ type TweetManageA struct { } func BuildShipIndexA(p PreparexBuilder) (obj *ShipIndexA, err error) { - obj = &ShipIndexA{ UserInfo: p.QueryHook(_ShipIndexA_UserInfo), } @@ -133,7 +132,6 @@ func BuildShipIndexA(p PreparexBuilder) (obj *ShipIndexA, err error) { } func BuildSimpleIndexA(p PreparexBuilder) (obj *SimpleIndexA, err error) { - obj = &SimpleIndexA{ UserInfo: p.QueryHook(_SimpleIndexA_UserInfo), } @@ -192,7 +190,6 @@ func BuildTopicA(p PreparexBuilder, ctx ...context.Context) (obj *TopicA, err er } func BuildTweetA(p PreparexBuilder) (obj *TweetA, err error) { - obj = &TweetA{ AttachmentByTweetId: p.QueryHook(_TweetA_AttachmentByTweetId), FavoriteByTweetId: p.QueryHook(_TweetA_FavoriteByTweetId), @@ -211,7 +208,6 @@ func BuildTweetA(p PreparexBuilder) (obj *TweetA, err error) { } func BuildTweetHelpA(p PreparexBuilder) (obj *TweetHelpA, err error) { - obj = &TweetHelpA{ UserInfo: p.QueryHook(_TweetHelpA_UserInfo), } @@ -219,7 +215,6 @@ func BuildTweetHelpA(p PreparexBuilder) (obj *TweetHelpA, err error) { } func BuildTweetManageA(p PreparexBuilder) (obj *TweetManageA, err error) { - obj = &TweetManageA{ UserInfo: p.QueryHook(_TweetManageA_UserInfo), } diff --git a/examples/auto/bc/yesql.go b/examples/auto/bc/yesql.go index a16e29e..db07549 100644 --- a/examples/auto/bc/yesql.go +++ b/examples/auto/bc/yesql.go @@ -1,6 +1,6 @@ // Code generated by Yesql. DO NOT EDIT. // versions: -// - Yesql v1.8.3 +// - Yesql v1.8.4 package bc diff --git a/examples/auto/cc/yesql.go b/examples/auto/cc/yesql.go index cb68785..38fe0b8 100644 --- a/examples/auto/cc/yesql.go +++ b/examples/auto/cc/yesql.go @@ -1,6 +1,6 @@ // Code generated by Yesql. DO NOT EDIT. // versions: -// - Yesql v1.8.3 +// - Yesql v1.8.4 package cc @@ -736,7 +736,6 @@ func BuildTweet(p PreparexBuilder, ctx ...context.Context) (obj *Tweet, err erro } func BuildTweetHelp(p PreparexBuilder) (obj *TweetHelp, err error) { - obj = &TweetHelp{ GetPostContentByIds: p.QueryHook(_TweetHelp_GetPostContentByIds), GetUsersByIds: p.QueryHook(_TweetHelp_GetUsersByIds), diff --git a/examples/auto/yesql.go b/examples/auto/yesql.go index 3918fa4..91d2f2e 100644 --- a/examples/auto/yesql.go +++ b/examples/auto/yesql.go @@ -1,6 +1,6 @@ // Code generated by Yesql. DO NOT EDIT. // versions: -// - Yesql v1.8.3 +// - Yesql v1.8.4 package yesql diff --git a/examples/go.mod b/examples/go.mod index cdbaff6..895584b 100644 --- a/examples/go.mod +++ b/examples/go.mod @@ -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 ) diff --git a/template/sql.tmpl b/template/sql.tmpl index 6b09772..c7caf0d 100644 --- a/template/sql.tmpl +++ b/template/sql.tmpl @@ -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] @@ -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] diff --git a/template/sqlx.tmpl b/template/sqlx.tmpl index 8272556..60782bc 100644 --- a/template/sqlx.tmpl +++ b/template/sqlx.tmpl @@ -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] @@ -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] diff --git a/version.go b/version.go index f36c3c4..1b8491e 100644 --- a/version.go +++ b/version.go @@ -1,3 +1,3 @@ package yesql -var Version = "v1.8.3" +var Version = "v1.8.4"