diff --git a/docs/embedding.md b/docs/embedding.md index 2d0453b..4228841 100644 --- a/docs/embedding.md +++ b/docs/embedding.md @@ -41,10 +41,16 @@ the socket is created owner-only (`0600`), so only the embedding program's user ## go -`ffi/go` wraps the C api for go programs. point `CGO_LDFLAGS` at the directory with the static library: +`ffi/go` wraps the C api for go programs. the go module is the repo root, so get it with: ```bash -CGO_LDFLAGS=-L$PWD/target/release go build ./... +go get tangled.org/ptr.pet/hydrant/ffi/go +``` + +the header comes with the module, but the static library doesn't, so build it and point `CGO_LDFLAGS` at its directory: + +```bash +CGO_LDFLAGS=-L/path/to/hydrant/target/release go build ./... ``` ```go diff --git a/ffi/go/go.mod b/ffi/go/go.mod deleted file mode 100644 index 2a6e507..0000000 --- a/ffi/go/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module tangled.org/ptr.pet/hydrant/ffi/go - -go 1.24 diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..3f1181d --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +// the module sits at the repo root so it carries ffi/include/hydrant.h, +// and so go can find it, since tangled only answers go-get for the repo itself +module tangled.org/ptr.pet/hydrant + +go 1.24