I have a Go app where to use it, and therefore to test it, I need to build a .so
file. The tests work fine if I just do git test ./...
, but if I add the -coverprofile
flag, e.g. git test ./... -coverprofile=coverage.out
then building the .so
file fails with plugin.Open("<filepath to plugin>"): plugin was built with a different version of <package>
. Note that the package in question is one of my own packages, part of the app which the .so
file needs to import in order to interact with it.
I was expecting it to “just work” as it does when I do go test
without -coverprofile
. The only thing I can say I’ve “tried” is googling hard for clues and asking this same question in three other places, in all of which I drew a blank. There is nothing obvious to try. I’m baffled.
Thank you for your help.
user26651724 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.