mirror of
https://github.com/ent/ent.git
synced 2026-05-28 09:49:08 +03:00
entc/gen: change <E>WithError signature to <E>Err (#322)
<E>WithError is too verbose and we like short names
This commit is contained in:
@@ -47,9 +47,9 @@ type {{ $.Name }}Edges struct {
|
||||
}
|
||||
|
||||
{{- range $i, $e := . }}
|
||||
// {{ $e.StructField }}WithError returns the {{ $e.StructField }} value or an error if the edge
|
||||
// {{ $e.StructField }}Err returns the {{ $e.StructField }} value or an error if the edge
|
||||
// was not loaded in eager-loading{{ if $e.Unique }}, or loaded but was not found{{ end }}.
|
||||
func (e {{ $.Name }}Edges) {{ $e.StructField }}WithError() ({{ if not $e.Unique }}[]{{ end }}*{{ $e.Type.Name }}, error) {
|
||||
func (e {{ $.Name }}Edges) {{ $e.StructField }}Err() ({{ if not $e.Unique }}[]{{ end }}*{{ $e.Type.Name }}, error) {
|
||||
if e.loadedTypes[{{ $i }}] {
|
||||
{{- if $e.Unique }}
|
||||
if e.{{ $e.StructField }} == nil {
|
||||
|
||||
Reference in New Issue
Block a user