Go · Installation

Installation

6.0.0-rc.1 · 91a27bdd

Add the module to your project with go get:

go get github.com/ashvardanian/stringzilla/golang

The binding links libstringzilla_static through cgo, so programs carry it whole and need no shared library at runtime. Build it with the release_shared preset and copy it next to the Go sources:

cmake --preset release_shared
cmake --build --preset release_shared --target stringzilla_static
cp build_release_shared/libstringzilla_static.a golang/

An archive elsewhere, like the one STRINGZILLA_LIBRARY_DIR names for the Rust crate, links through CGO_LDFLAGS="-L$STRINGZILLA_LIBRARY_DIR".

Import it as:

import sz "github.com/ashvardanian/stringzilla/golang"