From 3846a95f12b92067045ffc5e98854d88ec4dd76e Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Wed, 22 Jul 2020 17:21:47 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9ACode=20generation=20configuration?= =?UTF-8?q?=20item?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/config/gen.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tools/config/gen.go diff --git a/tools/config/gen.go b/tools/config/gen.go new file mode 100644 index 00000000..09ba17b9 --- /dev/null +++ b/tools/config/gen.go @@ -0,0 +1,17 @@ +package config + +import "github.com/spf13/viper" + +type Gen struct { + DBName string + FrontPath string +} + +func InitGen(cfg *viper.Viper) *Gen { + return &Gen{ + DBName: cfg.GetString("dbname"), + FrontPath: cfg.GetString("frontpath"), + } +} + +var GenConfig = new(Gen)