style(go): 清掉存量 gofmt(6 个文件的字段对齐与文件末尾换行)

接入格式门禁前先量了一次存量:gofmt -l 在 295 个被跟踪的 .go 文件里报 6 个,
全是字段对齐与缺文件末尾换行这类机械问题。先一次性清干净,门禁接上后 Go 侧一条都不欠。

为什么独立一个提交:格式清理混进功能改动会让 diff 无法 review(正本要求存量清理独立提交)。
验证:gofmt -l 对被跟踪的 .go 文件输出为空;go vet 与 go test 全过。
This commit is contained in:
姚章浩
2026-10-12 00:10:31 +08:00
parent 5f3a71cade
commit c04abd6530
6 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -138,7 +138,7 @@ func run(ctx context.Context, getenv func(string) string) error {
ProductionReleaseAuthorizationToken: releaseAuthorizationToken,
// 数据源发现(系统设置 → 数据源配置):用与 worker 同一份 dws 状态做只读列举。
DingtalkSources: dingtalkSourceLister{},
BackupSchedule: postgresstore.NewStore(pool),
BackupSchedule: postgresstore.NewStore(pool),
BackupHost: backuphost.New(backuphost.Config{
SSHConfig: config.BackupHostSSHConfig,
Target: config.BackupHostTarget,
+1 -1
View File
@@ -47,4 +47,4 @@ func listDingtalkSources(w http.ResponseWriter, r *http.Request, config Config)
return
}
writeJSON(w, http.StatusOK, map[string]any{"data": result})
}
}
+3 -3
View File
@@ -128,9 +128,9 @@ type Config struct {
ProductionReleaseAuthorizationToken string
// DingtalkSources 枚举「我账号下能看到」的钉钉知识库与钉盘空间(只读,dws)。
// 未接线时对应路由返回 501,页面显示"列不出来"而不是空列表。
DingtalkSources dingtalkSourcesLister
NewID func() (string, error)
Auth *AuthConfig
DingtalkSources dingtalkSourcesLister
NewID func() (string, error)
Auth *AuthConfig
}
func NewHandler(config Config) (http.Handler, error) {
@@ -82,4 +82,4 @@ VALUES('conn-head','snap-head',now());`); err != nil {
if item.StartedAt.IsZero() {
t.Fatal("started_at should carry the scan start so the page can show a time")
}
}
}
+1 -1
View File
@@ -25,4 +25,4 @@ var (
Number = "dev"
CommitSHA = "unknown"
BuildTime = "unknown"
)
)
+1 -1
View File
@@ -37,4 +37,4 @@ func TestNumberMatchesChangelog(t *testing.T) {
"常见原因:改了 CHANGELOG 却没重新构建(产物还报旧号),"+
"或者构建时手填了一个 CHANGELOG 里没有的号", Number, want)
}
}
}