Cgo is somewhat tricky. I’m sure we could sort out the error if you showed it, but on the other hand we’re not going to merge a contribution that uses it. The reason is that it makes cross compilation significantly more difficult and also risks memory safety for the whole program.
I would hope that you can get quota information by calling the relevant syscall directly instead of adding a C implementation/wrapper.
Apparently you also need to figure out the path to the “block special device” that backs the filesystem, for the given path we’re interested in. That in itself might not be trivial.