From b1b0607123a38a9479aa5f5361a204b2bc0c7ee0 Mon Sep 17 00:00:00 2001 From: Patrick O'brien Date: Fri, 5 Aug 2016 15:03:37 +1000 Subject: [PATCH] Fix template errors --- templates/04_relationship_to_one.tpl | 8 ++++---- templates/05_relationship_to_many.tpl | 8 ++++---- templates/07_find.tpl | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/templates/04_relationship_to_one.tpl b/templates/04_relationship_to_one.tpl index 900fed3..d2a9e37 100644 --- a/templates/04_relationship_to_one.tpl +++ b/templates/04_relationship_to_one.tpl @@ -6,22 +6,22 @@ func ({{.Function.Receiver}} *{{.LocalTable.NameGo}}) {{.Function.Name}}G(mods . // {{.Function.Name}}GP pointed to by the foreign key. Panics on error. func ({{.Function.Receiver}} *{{.LocalTable.NameGo}}) {{.Function.Name}}GP(mods ...qm.QueryMod) *{{.ForeignTable.NameGo}} { - o, err := {{.Function.Receiver}}.{{.Function.Name}}(boil.GetDB(), mods...) + slice, err := {{.Function.Receiver}}.{{.Function.Name}}(boil.GetDB(), mods...) if err != nil { panic(boil.WrapErr(err)) } - return o + return slice } // {{.Function.Name}}P pointed to by the foreign key with exeuctor. Panics on error. func ({{.Function.Receiver}} *{{.LocalTable.NameGo}}) {{.Function.Name}}P(exec boil.Executor, mods ...qm.QueryMod) *{{.ForeignTable.NameGo}} { - o, err := {{.Function.Receiver}}.{{.Function.Name}}(exec, mods...) + slice, err := {{.Function.Receiver}}.{{.Function.Name}}(exec, mods...) if err != nil { panic(boil.WrapErr(err)) } - return o + return slice } // {{.Function.Name}} pointed to by the foreign key. diff --git a/templates/05_relationship_to_many.tpl b/templates/05_relationship_to_many.tpl index 676e7e6..bda8487 100644 --- a/templates/05_relationship_to_many.tpl +++ b/templates/05_relationship_to_many.tpl @@ -16,23 +16,23 @@ func ({{$rel.Function.Receiver}} *{{$rel.LocalTable.NameGo}}) {{$rel.Function.Na // {{$rel.Function.Name}}GP panics on error. Retrieves all the {{$rel.LocalTable.NameSingular}}'s {{$rel.ForeignTable.NameHumanReadable}} {{- if not (eq $rel.Function.Name $rel.ForeignTable.NamePluralGo)}} via {{.ForeignColumn}} column{{- end}}. func ({{$rel.Function.Receiver}} *{{$rel.LocalTable.NameGo}}) {{$rel.Function.Name}}GP(mods ...qm.QueryMod) {{$rel.ForeignTable.Slice}} { - o, err := {{$rel.Function.Receiver}}.{{$rel.Function.Name}}(boil.GetDB(), mods...) + slice, err := {{$rel.Function.Receiver}}.{{$rel.Function.Name}}(boil.GetDB(), mods...) if err != nil { panic(boil.WrapErr(err)) } - return o + return slice } // {{$rel.Function.Name}}P panics on error. Retrieves all the {{$rel.LocalTable.NameSingular}}'s {{$rel.ForeignTable.NameHumanReadable}} with an executor {{- if not (eq $rel.Function.Name $rel.ForeignTable.NamePluralGo)}} via {{.ForeignColumn}} column{{- end}}. func ({{$rel.Function.Receiver}} *{{$rel.LocalTable.NameGo}}) {{$rel.Function.Name}}P(exec boil.Executor, mods ...qm.QueryMod) {{$rel.ForeignTable.Slice}} { - o, err := {{$rel.Function.Receiver}}.{{$rel.Function.Name}}(exec, mods...) + slice, err := {{$rel.Function.Receiver}}.{{$rel.Function.Name}}(exec, mods...) if err != nil { panic(boil.WrapErr(err)) } - return o + return slice } // {{$rel.Function.Name}} retrieves all the {{$rel.LocalTable.NameSingular}}'s {{$rel.ForeignTable.NameHumanReadable}} with an executor diff --git a/templates/07_find.tpl b/templates/07_find.tpl index 4ebb127..6e4959c 100644 --- a/templates/07_find.tpl +++ b/templates/07_find.tpl @@ -11,12 +11,12 @@ func {{$tableNameSingular}}FindG({{$pkArgs}}, selectCols ...string) (*{{$tableNa // {{$tableNameSingular}}FindGP retrieves a single record by ID, and panics on error. func {{$tableNameSingular}}FindGP({{$pkArgs}}, selectCols ...string) *{{$tableNameSingular}} { - o, err := {{$tableNameSingular}}Find(boil.GetDB(), {{$pkNames | join ", "}}, selectCols...) + retobj, err := {{$tableNameSingular}}Find(boil.GetDB(), {{$pkNames | join ", "}}, selectCols...) if err != nil { panic(boil.WrapErr(err)) } - return o + return retobj } // {{$tableNameSingular}}Find retrieves a single record by ID with an executor. @@ -43,10 +43,10 @@ func {{$tableNameSingular}}Find(exec boil.Executor, {{$pkArgs}}, selectCols ...s // {{$tableNameSingular}}FindP retrieves a single record by ID with an executor, and panics on error. func {{$tableNameSingular}}FindP(exec boil.Executor, {{$pkArgs}}, selectCols ...string) *{{$tableNameSingular}} { - o, err := {{$tableNameSingular}}Find(exec, {{$pkNames | join ", "}}, selectCols...) + retobj, err := {{$tableNameSingular}}Find(exec, {{$pkNames | join ", "}}, selectCols...) if err != nil { panic(boil.WrapErr(err)) } - return o + return retobj }