Fix test and runes in ShortID()

This commit is contained in:
Theodor S. Midtlien
2026-06-08 14:50:26 +02:00
parent f98fe1e9ec
commit 3bb44e72db
3 changed files with 7 additions and 6 deletions
+3 -2
View File
@@ -106,10 +106,11 @@ func (id ID) ShortID() string {
if id == DefaultProfileName {
return DefaultProfileName
}
if len(id) <= shortIDLen {
runes := []rune(id)
if len(runes) <= shortIDLen {
return id.String()
}
return id.String()[:shortIDLen]
return string(runes[:shortIDLen])
}
func (id ID) String() string {