diff --git a/util/truncate/truncate.go b/util/truncate/truncate.go index b13dc6f10..310b81dd0 100644 --- a/util/truncate/truncate.go +++ b/util/truncate/truncate.go @@ -9,7 +9,7 @@ // bytes. If s exceeds this length, it is truncated at a point ≤ n so that the // result does not end in a partial UTF-8 encoding. If s is less than or equal // to this length, it is returned unmodified. -func String(s string, n int) string { +func String[String ~string | ~[]byte](s String, n int) String { if n >= len(s) { return s }