diff --git a/association.go b/association.go index aa740fc5..e59b8938 100644 --- a/association.go +++ b/association.go @@ -170,7 +170,7 @@ func (association *Association) Replace(values ...interface{}) error { if column, values := schema.ToQueryValues(rel.JoinTable.Table, joinPrimaryKeys, pvs); len(values) > 0 { tx.Where(clause.IN{Column: column, Values: values}) } else { - return ErrorPrimaryKeyRequired + return ErrPrimaryKeyRequired } _, rvs := schema.GetIdentityFieldValuesMapFromValues(values, relPrimaryFields) diff --git a/errors.go b/errors.go index 12e64611..115b8e25 100644 --- a/errors.go +++ b/errors.go @@ -15,10 +15,10 @@ var ( ErrMissingWhereClause = errors.New("WHERE conditions required") // ErrUnsupportedRelation unsupported relations ErrUnsupportedRelation = errors.New("unsupported relations") - // ErrorPrimaryKeyRequired primary keys required - ErrorPrimaryKeyRequired = errors.New("primary key required") - // ErrorModelValueRequired model value required - ErrorModelValueRequired = errors.New("model value required") + // ErrPrimaryKeyRequired primary keys required + ErrPrimaryKeyRequired = errors.New("primary key required") + // ErrModelValueRequired model value required + ErrModelValueRequired = errors.New("model value required") // ErrUnsupportedDriver unsupported driver ErrUnsupportedDriver = errors.New("unsupported driver") // ErrRegistered registered diff --git a/finisher_api.go b/finisher_api.go index 6bfe5d20..77bea578 100644 --- a/finisher_api.go +++ b/finisher_api.go @@ -325,7 +325,7 @@ func (db *DB) Pluck(column string, dest interface{}) (tx *DB) { } } } else if tx.Statement.Table == "" { - tx.AddError(ErrorModelValueRequired) + tx.AddError(ErrModelValueRequired) } fields := strings.FieldsFunc(column, utils.IsChar) diff --git a/statement.go b/statement.go index 310484d8..e9d826c4 100644 --- a/statement.go +++ b/statement.go @@ -96,7 +96,7 @@ func (stmt *Statement) QuoteTo(writer clause.Writer, field interface{}) { if v.Name == clause.PrimaryKey { if stmt.Schema == nil { - stmt.DB.AddError(ErrorModelValueRequired) + stmt.DB.AddError(ErrModelValueRequired) } else if stmt.Schema.PrioritizedPrimaryField != nil { stmt.DB.Dialector.QuoteTo(writer, stmt.Schema.PrioritizedPrimaryField.DBName) } else if len(stmt.Schema.DBNames) > 0 {