mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: remove unnecessary import from templates (#3105)
This commit is contained in:
@@ -219,7 +219,6 @@ var (
|
||||
"time": "time",
|
||||
"ent": "entgo.io/ent",
|
||||
"dialect": "entgo.io/ent/dialect",
|
||||
"schema": "entgo.io/ent/schema",
|
||||
"field": "entgo.io/ent/schema/field",
|
||||
}
|
||||
)
|
||||
|
||||
@@ -42,7 +42,7 @@ import (
|
||||
{{- $fields := $.Fields }}{{ if $.HasOneFieldID }}{{ if $.ID.UserDefined }}{{ $fields = append $fields $.ID }}{{ end }}{{ end }}
|
||||
{{- range $f := $fields }}
|
||||
{{- $pkg := $f.Type.PkgPath }}
|
||||
{{- if and $pkg (not (hasImport (base $pkg ))) }}
|
||||
{{- if and $pkg (not (hasImport (base $pkg))) }}
|
||||
{{- $name := $f.Type.PkgName }}
|
||||
{{ if ne $name (base $pkg) }}{{ $name }} {{ end}}"{{ $pkg }}"
|
||||
{{- end }}
|
||||
|
||||
Reference in New Issue
Block a user