mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
go: small refactoring for maps (#2619)
This commit is contained in:
@@ -63,10 +63,10 @@ func (a Annotation) Merge(other schema.Annotation) schema.Annotation {
|
||||
default:
|
||||
return a
|
||||
}
|
||||
if a.StructTag == nil && len(ant.StructTag) > 0 {
|
||||
a.StructTag = make(map[string]string, len(ant.StructTag))
|
||||
}
|
||||
for k, v := range ant.StructTag {
|
||||
if a.StructTag == nil {
|
||||
a.StructTag = make(map[string]string)
|
||||
}
|
||||
a.StructTag[k] = v
|
||||
}
|
||||
if len(ant.ID) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user