From 19562221f9bab4950b8430c08f702de71ed70531 Mon Sep 17 00:00:00 2001 From: bandl <1658002533@qq.com> Date: Mon, 25 Oct 2021 15:23:36 +0800 Subject: [PATCH] chore(pluigin): init pluugins --- plugins/config/middle.gen.go | 3 ++- plugins/config/middle.template | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/config/middle.gen.go b/plugins/config/middle.gen.go index 8030d69..c989fd7 100644 --- a/plugins/config/middle.gen.go +++ b/plugins/config/middle.gen.go @@ -12,8 +12,9 @@ import ( func GetMiddlewareMap() map[string]plugins.PluginInterface { mockPlugin := mockPlugin.NewPlugin() - return map[string]plugins.PluginInterface{ + mockPlugin.Init() + return map[string]plugins.PluginInterface{ mockPlugin.Name(): mockPlugin, } } diff --git a/plugins/config/middle.template b/plugins/config/middle.template index a11e1d6..b90bd12 100644 --- a/plugins/config/middle.template +++ b/plugins/config/middle.template @@ -14,9 +14,10 @@ import ( func GetMiddlewareMap() map[string]plugins.PluginInterface { {%for dir in dirs %} {{dir[0]}}:={{dir[0]}}.NewPlugin() - {%- endfor%} + {{dir[0]}}.Init() + {% endfor%} return map[string]plugins.PluginInterface{ - {%for dir in dirs %} + {%for dir in dirs -%} {{dir[0]}}.Name():{{dir[0]}}, {%- endfor%} }