Skip to content

Commit

Permalink
Merge pull request #1 from lulucas/modelgen-hook-patch-1
Browse files Browse the repository at this point in the history
modelgen hook docs use plugin poitner
  • Loading branch information
lulucas authored Nov 25, 2019
2 parents 15b3058 + 33fc16b commit 63be1d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/content/recipes/modelgen-hook.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
)

// Defining mutation function
func mutateHook(b *ModelBuild) *ModelBuild {
func mutateHook(b *modelgen.ModelBuild) *modelgen.ModelBuild {
for _, model := range b.Models {
for _, field := range model.Fields {
field.Tag += ` orm_binding:"` + model.Name + `.` + field.Name + `"`
Expand All @@ -49,7 +49,7 @@ func main() {

err = api.Generate(cfg,
api.NoPlugins(),
api.AddPlugin(p),
api.AddPlugin(&p),
)
if err != nil {
fmt.Fprintln(os.Stderr, err.Error())
Expand Down

0 comments on commit 63be1d5

Please sign in to comment.