Skip to content

Commit

Permalink
fix: typo (#7003)
Browse files Browse the repository at this point in the history
* fix: typo

* fix: covered
  • Loading branch information
hakusai22 authored May 8, 2024
1 parent 9d370bc commit 5e599a0
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func Scan(rows Rows, db *DB, mode ScanMode) {
rel = rel.FieldSchema.Relationships.Relations[name]
relFields = append(relFields, rel.Field)
}
// lastest name is raw dbname
// latest name is raw dbname
dbName := names[subNameCount-1]
if field := rel.FieldSchema.LookUpField(dbName); field != nil && field.Readable {
fields[idx] = field
Expand Down
2 changes: 1 addition & 1 deletion tests/embedded_struct_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,6 @@ func TestEmbeddedTagSetting(t *testing.T) {
err = DB.Save(&t1).Error
AssertEqual(t, err, nil)
if t1.Tag1.Id == 0 {
t.Errorf("embedded struct's primary field should be rewrited")
t.Errorf("embedded struct's primary field should be rewritten")
}
}
2 changes: 1 addition & 1 deletion tests/non_std_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestNonStdPrimaryKeyAndDefaultValues(t *testing.T) {
}

animal = Animal{From: "somewhere"} // No name fields, should be filled with the default value (galeone)
DB.Save(&animal).Update("From", "a nice place") // The name field shoul be untouched
DB.Save(&animal).Update("From", "a nice place") // The name field should be untouched
DB.First(&animal, animal.Counter)
if animal.Name != "galeone" {
t.Errorf("Name fields shouldn't be changed if untouched, but got %v", animal.Name)
Expand Down
4 changes: 2 additions & 2 deletions tests/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ func TestQueryResetNullValue(t *testing.T) {
Number1 int64 `gorm:"default:NULL"`
Number2 uint64 `gorm:"default:NULL"`
Number3 float64 `gorm:"default:NULL"`
Now *time.Time `gorm:"defalut:NULL"`
Now *time.Time `gorm:"default:NULL"`
Item1Id string
Item1 *QueryResetItem `gorm:"references:ID"`
Item2Id string
Expand Down Expand Up @@ -1427,7 +1427,7 @@ func TestQueryScanToArray(t *testing.T) {
t.Fatal(err)
}
if users[0] == nil || users[0].Name != "testname1" {
t.Error("users[0] not covere")
t.Error("users[0] not covered")
}
if users[1] != nil {
t.Error("users[1] should be empty")
Expand Down
2 changes: 1 addition & 1 deletion tests/transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func TestTransaction(t *testing.T) {
return tx5.First(&User{}, "name = ?", "transaction-2").Error
})
}); err != nil {
t.Fatalf("prepare statement and nested transcation coexist" + err.Error())
t.Fatalf("prepare statement and nested transaction coexist" + err.Error())
}
})
}
Expand Down

0 comments on commit 5e599a0

Please sign in to comment.