Files
llgo/_demo/concat/concat.go

22 lines
315 B
Go
Raw Normal View History

2024-05-06 22:31:33 +08:00
package main
import (
2025-04-03 15:52:18 +08:00
"github.com/goplus/lib/c"
2024-05-06 22:31:33 +08:00
)
func concat(args ...string) (ret string) {
for _, v := range args {
ret += v
}
return
}
func main() {
result := concat("Hello", " ", "World")
c.Fprintf(c.Stderr, c.Str("Hi, %s\n"), c.AllocaCStr(result))
}
/* Expected output (stderr):
Hi, Hello World
*/