entc/gen: remove todo from template (#3385)

This commit is contained in:
Ariel Mashraki
2023-03-13 18:57:12 +02:00
committed by GitHub
parent 148f7d51a0
commit acc4c5aac6

View File

@@ -70,9 +70,7 @@ func ({{ $receiver }} *{{ $builder }}) createSpec() (*{{ $.Name }}, *sqlgraph.Cr
{{- xtemplate $tmpl $ }}
{{- end }}
{{- end }}
{{- if $.HasCompositeID }}
{{- /* TODO(a8m): Remove redudent if-s when Go 1.19 released as short-circuit was added in 1.18. */}}
{{- else if $.ID.UserDefined }}
{{- if and (not $.HasCompositeID) $.ID.UserDefined }}
if id, ok := {{ $mutation }}.{{ $.ID.MutationGet }}(); ok {
_node.ID = id
_spec.ID.Value = {{ if and $.ID.Type.ValueScanner (not $.ID.Type.RType.IsPtr) }}&{{ end }}id