chore: gofumpt style

This commit is contained in:
a631807682 2022-06-30 15:14:19 +08:00
parent d4b7f3ddb8
commit 4b16c15d93
No known key found for this signature in database
GPG Key ID: 137D1D75522168AB
3 changed files with 5 additions and 5 deletions

View File

@ -1,9 +1,10 @@
package tests_test package tests_test
import ( import (
"testing"
"gorm.io/gorm" "gorm.io/gorm"
. "gorm.io/gorm/utils/tests" . "gorm.io/gorm/utils/tests"
"testing"
) )
func TestMany2ManyAssociation(t *testing.T) { func TestMany2ManyAssociation(t *testing.T) {

View File

@ -830,11 +830,11 @@ func TestUniqueColumn(t *testing.T) {
value, ok = ct.DefaultValue() value, ok = ct.DefaultValue()
AssertEqual(t, "", value) AssertEqual(t, "", value)
AssertEqual(t, false, ok) AssertEqual(t, false, ok)
} }
func findColumnType(dest interface{}, columnName string) ( func findColumnType(dest interface{}, columnName string) (
foundColumn gorm.ColumnType, err error) { foundColumn gorm.ColumnType, err error,
) {
columnTypes, err := DB.Migrator().ColumnTypes(dest) columnTypes, err := DB.Migrator().ColumnTypes(dest)
if err != nil { if err != nil {
err = fmt.Errorf("ColumnTypes err:%v", err) err = fmt.Errorf("ColumnTypes err:%v", err)

View File

@ -113,7 +113,6 @@ func TestSerializer(t *testing.T) {
} }
AssertEqual(t, result, data) AssertEqual(t, result, data)
} }
func TestSerializerAssignFirstOrCreate(t *testing.T) { func TestSerializerAssignFirstOrCreate(t *testing.T) {
@ -152,7 +151,7 @@ func TestSerializerAssignFirstOrCreate(t *testing.T) {
} }
AssertEqual(t, result, out) AssertEqual(t, result, out)
//update record // update record
data.Roles = append(data.Roles, "r3") data.Roles = append(data.Roles, "r3")
data.JobInfo.Location = "Gates Hillman Complex" data.JobInfo.Location = "Gates Hillman Complex"
if err := DB.Assign(data).FirstOrCreate(&out).Error; err != nil { if err := DB.Assign(data).FirstOrCreate(&out).Error; err != nil {