lint: remove strings

This commit is contained in:
Mo Huishou 2025-07-22 07:09:23 +00:00
parent 173af3e871
commit 362fda45ca

View File

@ -3,7 +3,6 @@ package callbacks
import (
"fmt"
"reflect"
"strings"
"gorm.io/gorm"
"gorm.io/gorm/clause"
@ -370,7 +369,7 @@ func ConvertToCreateValues(stmt *gorm.Statement) (values clause.Values) {
for _, column := range values.Columns {
if field := stmt.Schema.LookUpField(column.Name); field != nil {
if v, ok := selectColumns[field.DBName]; (ok && v) || (!ok && !restricted) {
if !field.PrimaryKey && field.AutoCreateTime == 0 &&
if !field.PrimaryKey && field.AutoCreateTime == 0 &&
(!field.HasDefaultValue || field.DefaultValueInterface != nil || field.DefaultValue != "") {
if field.AutoUpdateTime > 0 {
assignment := clause.Assignment{Column: clause.Column{Name: field.DBName}, Value: curTime}