diff --git a/generator/args.go b/generator/args.go index 7a4092a..5be1881 100644 --- a/generator/args.go +++ b/generator/args.go @@ -53,4 +53,3 @@ func parseArgs(exampleDataSourceName string) (dataSourceName string, tableNames return } - diff --git a/generator/generator.go b/generator/generator.go index 97757f9..324a859 100644 --- a/generator/generator.go +++ b/generator/generator.go @@ -119,6 +119,7 @@ func ensureIdentifier(name string) string { return result } +// Generate generates code for the given driverName. func Generate(driverName string, exampleDataSourceName string) (string, error) { dataSourceName, tableNames := parseArgs(exampleDataSourceName) diff --git a/select.go b/select.go index 361f8e4..cba08ee 100644 --- a/select.go +++ b/select.go @@ -328,7 +328,7 @@ func (s selectStatus) Offset(offset int) selectWithOffset { } func (s selectStatus) Count() (count int, err error) { - if s.lastUnion == nil && len(s.base.groupBys) == 0 && s.limit == nil { + if s.lastUnion == nil && len(s.base.groupBys) == 0 && s.limit == nil { if s.base.distinct { fields := s.base.fields s.base.distinct = false diff --git a/sqlingo-gen-sqlite3/main.go b/sqlingo-gen-sqlite3/main.go index 248c17d..7a0f0d9 100644 --- a/sqlingo-gen-sqlite3/main.go +++ b/sqlingo-gen-sqlite3/main.go @@ -2,8 +2,8 @@ package main import ( "fmt" - _ "github.com/mattn/go-sqlite3" "github.com/lqs/sqlingo/generator" + _ "github.com/mattn/go-sqlite3" ) func main() { diff --git a/update.go b/update.go index 11bca3d..76a0100 100644 --- a/update.go +++ b/update.go @@ -59,9 +59,8 @@ func (s updateStatus) Set(field Field, value interface{}) updateWithSet { func (s updateStatus) SetIf(condition bool, field Field, value interface{}) updateWithSet { if condition { return s.Set(field, value) - } else { - return s } + return s } func (s updateStatus) Where(conditions ...BooleanExpression) updateWithWhere {