entc/gen: less sophisticated naming logic (#774)

Closed #772
This commit is contained in:
Ariel Mashraki
2020-09-17 09:19:55 +03:00
committed by GitHub
parent 235973cc2d
commit 17abe2d60f
225 changed files with 5542 additions and 1679 deletions

View File

@@ -11,7 +11,7 @@ in the LICENSE file in the root directory of this source tree.
{{ $mutation := print $receiver ".mutation" }}
{{ $one := hasSuffix $builder "One" }}
{{- $zero := 0 }}{{ if $one }}{{ $zero = "nil" }}{{ end }}
{{- $ret := "n" }}{{ if $one }}{{ $ret = $.Receiver }}{{ end }}
{{- $ret := "n" }}{{ if $one }}{{ $ret = "_node" }}{{ end }}
func ({{ $receiver }} *{{ $builder }}) sqlSave(ctx context.Context) ({{ $ret }} {{ if $one }}*{{ $.Name }}{{ else }}int{{ end }}, err error) {
_spec := &sqlgraph.UpdateSpec{