Label: GO

Go (golang) — компилируемый язык программирования, разработанный в Google для создания производительных серверных и сетевых приложений. Язык также часто называют Golang, хотя официальное название — Go. golang отличается простым синтаксисом, высокой скоростью компиляции и эффективной работой с многопоточностью. Одной из ключевых особенностей языка являются goroutine — лёгкие потоки выполнения для параллельных задач. Программы на golang компилируются в нативный код и не требуют виртуальной машины для запуска. Язык широко используется при разработке backend-сервисов, облачной инфраструктуры и DevOps-инструментов. На golang написаны такие проекты как Docker и Kubernetes. Go ценят за сочетание производительности, простоты и удобства сопровождения кода.

String transfer from a function in GO to a code in C without memory allocation (Part 2)

We were discussing a possibility of string transfer without memory allocation in the previous article. Attempts to use this method in the real projects revealed that there are cases when this method is not applicable. Everything is working just fine if a string object is constructed from a static string constant or by means of

String transfer from a function in GO to a code on C without memory allocation (Part 1)

CGO documentation illuminates string transfer issue rather poorly. They only mention that C.CString() function should be used in order to convert a string object into a pointer to a buffer with a zero-terminated string – char*, which is coherent for the C code. This is great; however, a memory block is being allocated during this procedure