mirror of https://github.com/go-gorm/gorm.git
Merge pull request #1352 from DiSiqueira/small_changes
Fixing 4 typos in comments and gofmt -s in all files
This commit is contained in:
commit
5050a58b45
|
@ -175,6 +175,6 @@ func TestOmitWithCreate(t *testing.T) {
|
||||||
|
|
||||||
if queryuser.BillingAddressID.Int64 != 0 || queryuser.ShippingAddressId == 0 ||
|
if queryuser.BillingAddressID.Int64 != 0 || queryuser.ShippingAddressId == 0 ||
|
||||||
queryuser.CreditCard.ID != 0 || len(queryuser.Emails) != 0 {
|
queryuser.CreditCard.ID != 0 || len(queryuser.Emails) != 0 {
|
||||||
t.Errorf("Should not create omited relationships")
|
t.Errorf("Should not create omitted relationships")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,7 @@ func TestUpdateWithNoStdPrimaryKeyAndDefaultValues(t *testing.T) {
|
||||||
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 shoul be untouched
|
||||||
DB.First(&animal, animal.Counter)
|
DB.First(&animal, animal.Counter)
|
||||||
if animal.Name != "galeone" {
|
if animal.Name != "galeone" {
|
||||||
t.Errorf("Name fiels shouldn't be changed if untouched, but got %v", animal.Name)
|
t.Errorf("Name fields shouldn't be changed if untouched, but got %v", animal.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// When changing a field with a default value, the change must occur
|
// When changing a field with a default value, the change must occur
|
||||||
|
@ -300,7 +300,7 @@ func TestOmitWithUpdate(t *testing.T) {
|
||||||
queryUser.ShippingAddressId == user.ShippingAddressId ||
|
queryUser.ShippingAddressId == user.ShippingAddressId ||
|
||||||
queryUser.CreditCard.ID != user.CreditCard.ID ||
|
queryUser.CreditCard.ID != user.CreditCard.ID ||
|
||||||
len(queryUser.Emails) != len(user.Emails) || queryUser.Company.Id != user.Company.Id {
|
len(queryUser.Emails) != len(user.Emails) || queryUser.Company.Id != user.Company.Id {
|
||||||
t.Errorf("Should only update relationships that not omited")
|
t.Errorf("Should only update relationships that not omitted")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -336,7 +336,7 @@ func TestOmitWithUpdateWithMap(t *testing.T) {
|
||||||
queryUser.ShippingAddressId == user.ShippingAddressId ||
|
queryUser.ShippingAddressId == user.ShippingAddressId ||
|
||||||
queryUser.CreditCard.ID != user.CreditCard.ID ||
|
queryUser.CreditCard.ID != user.CreditCard.ID ||
|
||||||
len(queryUser.Emails) != len(user.Emails) || queryUser.Company.Id != user.Company.Id {
|
len(queryUser.Emails) != len(user.Emails) || queryUser.Company.Id != user.Company.Id {
|
||||||
t.Errorf("Should only update relationships not omited")
|
t.Errorf("Should only update relationships not omitted")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
utils.go
2
utils.go
|
@ -137,7 +137,7 @@ func toQueryMarks(primaryValues [][]interface{}) string {
|
||||||
|
|
||||||
for _, primaryValue := range primaryValues {
|
for _, primaryValue := range primaryValues {
|
||||||
var marks []string
|
var marks []string
|
||||||
for _, _ = range primaryValue {
|
for range primaryValue {
|
||||||
marks = append(marks, "?")
|
marks = append(marks, "?")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue