Skip to content

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

Description

@dairui520

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>

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions