I am developing a project where plugins are built on startup:
func BuildPlugin(path *string) error {
buildGo := "go"
buildArgs := []string{
"build",
"-buildmode=plugin",
"-o",
filepath.Join(*path, "ext/ext.so"),
filepath.Join(*path, "ext/ext.go"),
}
cmd := exec.Command(buildGo, buildArgs...)
_, err := cmd.Output()
if err != nil {
return err
}
return nil
}
When I run the program, the plugins load successfully, however when I run the tests, I get the following error:
fsm_test.go:34: plugin.Open("../examples/00_test/ext/ext"): plugin was built with a different version of package github.com/jaimeteb/chatto/fsm
I have read some solutions for similar problems but none have worked yet.
This is the project in question: github.com/jaimeteb/chatto