mirror of
https://github.com/ent/ent.git
synced 2026-04-28 05:30:56 +03:00
schema/field: fix uuid import path config
This commit is contained in:
committed by
Ariel Mashraki
parent
8979de939e
commit
43e74a334f
@@ -131,7 +131,7 @@ func UUID(name string, typ driver.Valuer) *uuidBuilder {
|
||||
Type: TypeUUID,
|
||||
Nillable: true,
|
||||
Ident: rt.String(),
|
||||
PkgPath: rt.PkgPath(),
|
||||
PkgPath: indirect(rt).PkgPath(),
|
||||
},
|
||||
}}
|
||||
}
|
||||
|
||||
@@ -523,6 +523,10 @@ func TestField_UUID(t *testing.T) {
|
||||
assert.Equal(t, "comment", fd.Comment)
|
||||
assert.True(t, fd.Nillable)
|
||||
|
||||
fd = field.UUID("id", &uuid.UUID{}).
|
||||
Descriptor()
|
||||
assert.Equal(t, "github.com/google/uuid", fd.Info.PkgPath)
|
||||
|
||||
fd = field.UUID("id", uuid.UUID{}).
|
||||
Default(uuid.UUID{}).
|
||||
Descriptor()
|
||||
|
||||
Reference in New Issue
Block a user