1
0
mirror of https://github.com/xorcare/testing-go-code-with-postgres.git synced 2025-06-30 23:23:40 +02:00

Replace 'Dash' with 'Hyphen'

That's a more correct title.
This commit is contained in:
Vasiliy Vasilyuk
2023-10-11 20:26:28 +03:00
parent 31d6570cd7
commit 942c43a636

View File

@ -124,16 +124,16 @@ func newUniqueHumanReadableDatabaseName(t TestingT) string {
uid := genUnique8BytesID(t) uid := genUnique8BytesID(t)
maxHumanReadableLenBytes := maxIdentifierLengthBytes - len(uid) maxHumanReadableLenBytes := maxIdentifierLengthBytes - len(uid)
lastSymbolIsDash := false lastSymbolIsHyphen := false
for _, r := range t.Name() { for _, r := range t.Name() {
if unicode.IsLetter(r) || unicode.IsNumber(r) { if unicode.IsLetter(r) || unicode.IsNumber(r) {
output.WriteRune(r) output.WriteRune(r)
lastSymbolIsDash = false lastSymbolIsHyphen = false
} else { } else {
if !lastSymbolIsDash { if !lastSymbolIsHyphen {
output.WriteRune('-') output.WriteRune('-')
} }
lastSymbolIsDash = true lastSymbolIsHyphen = true
} }
if output.Len() >= maxHumanReadableLenBytes { if output.Len() >= maxHumanReadableLenBytes {
break break