From 076ecf29fce3e69afa8e83077e75099e8b1aba8c Mon Sep 17 00:00:00 2001 From: SanaeFox <36219542+Hoshinonyaruko@users.noreply.github.com> Date: Sat, 4 Nov 2023 00:50:37 +0800 Subject: [PATCH] Test4 (#40) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Compiled main.go and pushed changes * test * 适配了频道私聊,用bolt数据库取代ini * 适配了nonebot2 * add license * add a lot * trss support * add action * add action * add action * fixbug * add wss * bugfix * fix action * fix action again * fa * fix * add a lot * add ws server token * bugifx * fixat * bugfix * bugfix * test * test2 * add url service * add url service * bugfix * fix * fix * fix * bug fix * fix * test * add webui * add image_compress * bug fix * fix cq code * fixbug * bugfix * bugfix * bugfix * bugfix * bugfix --- config/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/config.go b/config/config.go index 0d267b7b..c81fb4d0 100644 --- a/config/config.go +++ b/config/config.go @@ -149,8 +149,8 @@ func getMissingSettingsByReflection(currentConfig, defaultConfig *Config) (map[s for i := 0; i < currentVal.NumField(); i++ { field := currentVal.Type().Field(i) yamlTag := field.Tag.Get("yaml") - if yamlTag == "" { - continue + if yamlTag == "" || field.Type.Kind() == reflect.Int || field.Type.Kind() == reflect.Bool { + continue // 跳过没有yaml标签的字段,或者字段类型为int或bool } yamlKeyName := strings.SplitN(yamlTag, ",", 2)[0] if isZeroOfUnderlyingType(currentVal.Field(i).Interface()) && !isZeroOfUnderlyingType(defaultVal.Field(i).Interface()) {