feat: count characters consistently

This commit is contained in:
Sam 2023-04-02 22:50:22 +02:00
parent 80ca1cae00
commit 8433a1523a
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
9 changed files with 54 additions and 20 deletions

11
backend/common/common.go Normal file
View file

@ -0,0 +1,11 @@
// Package common contains functions and types common to all (or most) packages.
package common
import "unicode/utf8"
func StringLength(s *string) int {
if s == nil {
return -1
}
return utf8.RuneCountInString(*s)
}