You've already forked testing-go-code-with-postgres
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:
@ -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
|
||||||
|
Reference in New Issue
Block a user