entc/gen: support local package names for generated packages

The new Alias option adds package aliases (local names) for all type-packages that
their import identifier conflicts with user-defined packages (i.e. GoType).
This commit is contained in:
Ariel Mashraki
2022-02-02 14:48:59 +02:00
committed by Ariel Mashraki
parent 51663407cf
commit 0e49dd1d9f
40 changed files with 409 additions and 347 deletions

View File

@@ -14,7 +14,7 @@ in the LICENSE file in the root directory of this source tree.
import (
"{{ $.Config.Package }}/predicate"
{{- range $n := $.Nodes }}
"{{ $.Config.Package }}/{{ $n.Package }}"
{{ $n.Alias }} "{{ $.Config.Package }}/{{ $n.PackageDir }}"
{{- end }}
"entgo.io/ent/dialect/sql"