fix:variable name

This commit is contained in:
zxysilent 2023-03-13 09:10:51 +08:00
parent e229346b00
commit 94c275367f
1 changed files with 4 additions and 4 deletions

View File

@ -19,11 +19,11 @@ import (
) )
func (statement *Statement) ifAddColUpdate(col *schemas.Column, includeVersion, includeUpdated, includeNil, func (statement *Statement) ifAddColUpdate(col *schemas.Column, includeVersion, includeUpdated, includeNil,
includeAutoIncr, isPrimaryKey, update bool) (bool, error) { includeAutoIncr, includePrimaryKey, update bool) (bool, error) {
columnMap := statement.ColumnMap columnMap := statement.ColumnMap
omitColumnMap := statement.OmitColumnMap omitColumnMap := statement.OmitColumnMap
unscoped := statement.unscoped unscoped := statement.unscoped
if !isPrimaryKey && col.IsPrimaryKey { if !includePrimaryKey && col.IsPrimaryKey {
return false, nil return false, nil
} }
if !includeVersion && col.IsVersion { if !includeVersion && col.IsVersion {
@ -66,7 +66,7 @@ func (statement *Statement) ifAddColUpdate(col *schemas.Column, includeVersion,
// BuildUpdates auto generating update columnes and values according a struct // BuildUpdates auto generating update columnes and values according a struct
func (statement *Statement) BuildUpdates(tableValue reflect.Value, func (statement *Statement) BuildUpdates(tableValue reflect.Value,
includeVersion, includeUpdated, includeNil, includeVersion, includeUpdated, includeNil,
includeAutoIncr, isPrimaryKey, update bool) ([]string, []interface{}, error) { includeAutoIncr, includePrimaryKey, update bool) ([]string, []interface{}, error) {
table := statement.RefTable table := statement.RefTable
allUseBool := statement.allUseBool allUseBool := statement.allUseBool
useAllCols := statement.useAllCols useAllCols := statement.useAllCols
@ -78,7 +78,7 @@ func (statement *Statement) BuildUpdates(tableValue reflect.Value,
for _, col := range table.Columns() { for _, col := range table.Columns() {
ok, err := statement.ifAddColUpdate(col, includeVersion, includeUpdated, includeNil, ok, err := statement.ifAddColUpdate(col, includeVersion, includeUpdated, includeNil,
includeAutoIncr, isPrimaryKey, update) includeAutoIncr, includePrimaryKey, update)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }