From e9ecd38609b012d78f5a4d8825e42ef272dbad29 Mon Sep 17 00:00:00 2001 From: xxj <346944475@qq.com> Date: Thu, 3 Dec 2020 16:31:32 +0800 Subject: [PATCH] add context import --- data/view/model/model.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/view/model/model.go b/data/view/model/model.go index 4ccf7fb..f738adf 100644 --- a/data/view/model/model.go +++ b/data/view/model/model.go @@ -235,8 +235,9 @@ func (m *_Model) generateFunc() (genOut []GenOutInfo) { for _, tab := range m.info.TabList { var pkg genstruct.GenPackage pkg.SetPackage(m.info.PackageName) //package name - pkg.AddImport(cnf.EImportsHead["gorm.Model"]) pkg.AddImport(`"fmt"`) + pkg.AddImport(`"context"`) // 添加import信息 + pkg.AddImport(cnf.EImportsHead["gorm.Model"]) data := funDef{ StructName: getCamelName(tab.Name),