I use a C library in Golang code by using Cgo. The problem is that it seems that the state of the global variables is not maintained each time the C functions are called.