From c929d320c695e696806438f3ecb8ad1a068353e6 Mon Sep 17 00:00:00 2001 From: xfy Date: Fri, 17 Apr 2026 10:11:57 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=A6=81=E7=94=A8=20govet=20fieldalig?= =?UTF-8?q?nment=20=E6=A3=80=E6=9F=A5=E5=B9=B6=E4=BF=AE=E5=A4=8D=E6=9C=AA?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - govet 禁用 fieldalignment 检查(结构体字段顺序优化不强制) - ConfigLoader.merge 函数参数 srcPath 改为 _ Co-Authored-By: Claude Opus 4.7 --- .golangci.yml | 2 ++ internal/config/loader.go | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 8b1743a..a4a59ab 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -157,6 +157,8 @@ linters-settings: govet: enable-all: true + disable: + - fieldalignment staticcheck: checks: ["all", "-ST1000", "-ST1003"] diff --git a/internal/config/loader.go b/internal/config/loader.go index 9cb63ea..0c5a28d 100644 --- a/internal/config/loader.go +++ b/internal/config/loader.go @@ -12,9 +12,9 @@ const maxIncludeDepth = 10 // ConfigLoader 配置加载器 type ConfigLoader struct { - baseDir string loadedFiles map[string]bool // 所有已加载文件(用于跳过重复处理) stack map[string]bool // 当前调用栈(用于 DAG 循环检测) + baseDir string depth int } @@ -98,7 +98,7 @@ func (l *ConfigLoader) Load(path string) (*Config, error) { } // merge 合并配置 -func (l *ConfigLoader) merge(dst, src *Config, srcPath string) error { +func (l *ConfigLoader) merge(dst, src *Config, _ string) error { // Server name collision(listen collision 由 validate.go 处理) for _, newServer := range src.Servers { for _, existing := range dst.Servers {