runtime: StringCat

This commit is contained in:
xushiwei
2024-05-01 22:00:34 +08:00
parent 52a64a7770
commit cf02f4a34f
5 changed files with 132 additions and 13 deletions

View File

@@ -55,6 +55,17 @@ func StringData(s String) unsafe.Pointer {
return s.data
}
// StringCat concatenates strings.
func StringCat(args ...String) String {
n := 0
for _, v := range args {
n += v.len
}
ret := Alloc(uintptr(n))
_ = ret
panic("todo")
}
// -----------------------------------------------------------------------------
// CStrCopy copies a Go string to a C string buffer and returns it.