From 23b958d199265e201713a75dea0dc2c509edd4b6 Mon Sep 17 00:00:00 2001 From: sunpeng Date: Wed, 12 Jul 2023 18:15:51 +0800 Subject: [PATCH] enh: support specify config file name --- infrastructure/config/config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/infrastructure/config/config.go b/infrastructure/config/config.go index b5f4c0e..fe00c74 100644 --- a/infrastructure/config/config.go +++ b/infrastructure/config/config.go @@ -14,6 +14,8 @@ import ( "github.com/taosdata/go-utils/web" ) +var Name = "taoskeeper" + type Config struct { Cors web.CorsConfig `toml:"cors"` Debug bool `toml:"debug"` @@ -36,7 +38,7 @@ type TDengineRestful struct { func InitConfig() *Config { viper.SetConfigType("toml") - viper.SetConfigName("taoskeeper") + viper.SetConfigName(Name) viper.AddConfigPath("/etc/taos") cp := pflag.StringP("c", "c", "", "taoskeeper config file")