Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I was using it in my go.mod project and encountered an error: error loading plugin plugin was built with a different version of package internal/abi #159

Open
dairui520 opened this issue Jul 11, 2024 · 0 comments

Comments

@dairui520
Copy link

My scenario is: deploy a go service and execute code dynamically by passing parameters. But after deploying the service, this error occurs. If I remove the third-party package, it runs normally.

code:

import (
	"fmt"

	"github.com/spf13/cast"
	"github.com/bytedance/sonic"
)

func getData(m map[string]interface{}) (string, error) {
    res :=""
	for _, v := range m {
		
		res += cast.ToString(v)
	}
	return sonic.MarshalString(m)
}

Service Log:

go: added github.com/bytedance/sonic/loader v0.1.1
go: added github.com/cloudwego/base64x v0.1.4
go: added github.com/cloudwego/iasm v0.2.0
go: added github.com/klauspost/cpuid/v2 v2.0.9
go: added github.com/spf13/cast v1.6.0
go: added github.com/twitchyliquid64/golang-asm v0.15.1
go: added golang.org/x/arch v0.0.0-20210923205945-b76863e36670
// debug: running "go mod tidy" ...
// debug: compiling plugin "/Users/go/src/gomacro.imports/gomacro_pid_25968/import_2" ...
error loading plugin "/Users/go/src/gomacro.imports/gomacro_pid_25968/import_2/import_2.so": plugin.Open("/Users/go/src/gomacro.imports/gomacro_pid_25968/import_2/import_2"): plugin was built with a different version of package internal/abi
repl.go:13:10: undefined "cast" in cast.ToString <*ast.SelectorExpr>

@dairui520 dairui520 changed the title I use it in the go.mod project and encounter errors. I don't know how to fix it I was using it in my go.mod project and encountered an error: error loading plugin plugin was built with a different version of package internal/abi Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant