From 9fe868ade97af8ee11a156ef1b78606e61e26ad9 Mon Sep 17 00:00:00 2001 From: Kevin Wan Date: Wed, 6 Apr 2022 23:24:20 +0800 Subject: [PATCH] chore: remove legacy code (#1766) --- tools/goctl/api/gogen/genhandlers.go | 4 ---- tools/goctl/api/gogen/handler.tpl | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/goctl/api/gogen/genhandlers.go b/tools/goctl/api/gogen/genhandlers.go index b30494d1..d073bf98 100644 --- a/tools/goctl/api/gogen/genhandlers.go +++ b/tools/goctl/api/gogen/genhandlers.go @@ -47,14 +47,10 @@ func genHandler(dir, rootPkg string, cfg *config.Config, group spec.Group, route return err } - goctlVersion := version.GetGoctlVersion() - // todo(anqiansong): This will be removed after a certain number of production versions of goctl (probably 5) - after1_1_10 := version.IsVersionGreaterThan(goctlVersion, "1.1.10") return doGenToFile(dir, handler, cfg, group, route, handlerInfo{ PkgName: pkgName, ImportPackages: genHandlerImports(group, route, parentPkg), HandlerName: handler, - After1_1_10: after1_1_10, RequestType: util.Title(route.RequestTypeName()), LogicName: logicName, LogicType: strings.Title(getLogicName(route)), diff --git a/tools/goctl/api/gogen/handler.tpl b/tools/goctl/api/gogen/handler.tpl index 0c92b885..033dc22e 100644 --- a/tools/goctl/api/gogen/handler.tpl +++ b/tools/goctl/api/gogen/handler.tpl @@ -3,7 +3,7 @@ package {{.PkgName}} import ( "net/http" - {{if .After1_1_10}}"github.com/zeromicro/go-zero/rest/httpx"{{end}} + "github.com/zeromicro/go-zero/rest/httpx" {{.ImportPackages}} )