In your library, spawn a goroutine, which
1. calls runtime.LockOSThread,
2. and then listens to commands on a channel,
3. calls the C library,
4. responds on a channel given beside the command
in a loop.
And hide all this, and create the API that translates direct calls to such command sending on the command channel,
waiting for the answer and returning it.
The essence is that the C-calling goroutine must be on the same thread where it has started.
This is to allow the C library to work, which assumes a lot about its calling environment when storing data in thread-local storage....