mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
Remove unused variable and type redundancy (#2996)
This commit is contained in:
@@ -258,7 +258,7 @@ func (c *{{ $client }}) Query() *{{ $n.QueryName }} {
|
||||
func (c *{{ $client }}) {{ $func }}({{ $arg }} *{{ $n.Name }}) *{{ $builder }} {
|
||||
{{- if $n.HasOneFieldID }}
|
||||
query := &{{ $builder }}{config: c.config}
|
||||
query.path = func(ctx context.Context) (fromV {{ $.Storage.Builder }}, _ error) {
|
||||
query.path = func(context.Context) (fromV {{ $.Storage.Builder }}, _ error) {
|
||||
{{- with extend $n "Receiver" $arg "Edge" $e "Ident" "fromV" }}
|
||||
{{ $tmpl := printf "dialect/%s/query/from" $.Storage }}
|
||||
{{- xtemplate $tmpl . -}}
|
||||
|
||||
@@ -136,7 +136,7 @@ func ({{ $receiver }} *{{ $builder }}) sqlAll(ctx context.Context, hooks ...quer
|
||||
outValue := {{ with extend $ "Arg" "values[0]" "Field" $.ID "ScanType" $out }}{{ template "dialect/sql/query/eagerloading/m2massign" . }}{{ end }}
|
||||
inValue := {{ with extend $ "Arg" "values[1]" "Field" $e.Type.ID "ScanType" $in }}{{ template "dialect/sql/query/eagerloading/m2massign" . }}{{ end }}
|
||||
if nids[inValue] == nil {
|
||||
nids[inValue] = map[*{{ $.Name }}]struct{}{byID[outValue]: struct{}{}}
|
||||
nids[inValue] = map[*{{ $.Name }}]struct{}{byID[outValue]: {}}
|
||||
return assign(columns[1:], values[1:])
|
||||
}
|
||||
nids[inValue][byID[outValue]] = struct{}{}
|
||||
|
||||
Reference in New Issue
Block a user