ci: fix lint and test failures

This commit is contained in:
shaw
2026-05-07 19:26:18 +08:00
parent 57fd7998d3
commit 8a835b22bb
2 changed files with 33 additions and 15 deletions

View File

@@ -249,16 +249,16 @@ func normalizeLoginAgreementDocumentID(raw string) string {
lastSeparator := false
for _, r := range raw {
if (r >= 'a' && r <= 'z') || (r >= '0' && r <= '9') {
b.WriteRune(r)
_, _ = b.WriteRune(r)
lastSeparator = false
continue
}
if r == '-' || r == '_' || r == ' ' || r == '.' || r == '/' {
if !lastSeparator && b.Len() > 0 {
if r == '_' {
b.WriteRune('_')
_, _ = b.WriteRune('_')
} else {
b.WriteRune('-')
_, _ = b.WriteRune('-')
}
lastSeparator = true
}