From 33fc16b1a75e745e28378452847f45a943fdd238 Mon Sep 17 00:00:00 2001 From: lulucas Date: Mon, 25 Nov 2019 14:58:53 +0800 Subject: [PATCH] modelgen hook docs use plugin poitner and add modelgen package to ModelBuild type --- docs/content/recipes/modelgen-hook.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/recipes/modelgen-hook.md b/docs/content/recipes/modelgen-hook.md index edc28861fbc..88d9fd967de 100644 --- a/docs/content/recipes/modelgen-hook.md +++ b/docs/content/recipes/modelgen-hook.md @@ -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 + `"` @@ -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())