metadata-2 (#2273)

Initial implementation of draft/metadata-2
This commit is contained in:
thatcher-gaming
2025-06-15 09:06:45 +01:00
committed by GitHub
parent 0f5603eca2
commit 4dcbc48159
16 changed files with 660 additions and 3 deletions
+28
View File
@@ -0,0 +1,28 @@
package utils
import "iter"
func ChunkifyParams(params iter.Seq[string], maxChars int) [][]string {
var chunked [][]string
var acc []string
var length = 0
for p := range params {
length = length + len(p) + 1 // (accounting for the space)
if length > maxChars {
chunked = append(chunked, acc)
acc = []string{}
length = 0
}
acc = append(acc, p)
}
if len(acc) != 0 {
chunked = append(chunked, acc)
}
return chunked
}