For fun, I've written a small library in C, to be used in an embedded C system.
After poking around with a few C unit-test libraries, I decided to test using go's "cgo"+"testing" packages as a way to learn the language.
Though I'm currently blocked on Issue 4030 to have cgo working, it looks like the testing library prevents users from importing the "C" package.
I understand that the testing package is built for golang unit tests, and it's a good practice to prevent users from using C from the tests that are meant to isolate their code, but this prevents me from being able to directly test my C code.
I've written a short .go file (and unit tests for it), but would prefer not to maintain the extra code.
// sample line from the .go file:
// ...
import "C"
func Call_c_foo() int {
return C.foo()
}
Is there a better/recommended way of doing this?