mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: allow package with alias on ID field (#2926)
* entc/gen: allow package with alias on ID field * Update entc/gen/template/import.tmpl Co-authored-by: Giau. Tran Minh <giau.tmg@gmail.com> Co-authored-by: Giau. Tran Minh <giau.tmg@gmail.com>
This commit is contained in:
@@ -19,7 +19,8 @@ import (
|
||||
"{{ $.Config.Package }}/predicate"
|
||||
{{- if $.HasOneFieldID }}
|
||||
{{- with $.ID.Type.PkgPath }}
|
||||
"{{ . }}"
|
||||
{{- $name := $.ID.Type.PkgName }}
|
||||
{{ if ne $name (base $.ID.Type.PkgPath) }}{{ $name }} {{ end}}"{{ . }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- /* Import external packages */}}
|
||||
|
||||
Reference in New Issue
Block a user