Using Golang to build a plugin for the Nakama runtime server. I was importing a few different packages (namely spf13/viper), however, the import required a different version of the same package that the runtime server uses, resulting in dependency pinning issues.
more specifically, importing github.com/spf13/viper
indirectly imports golang.org/x/sys v0.1.0
. However, nakama v1.25.0 requires golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d
.
I tried changing the x/sys
import to be v0.0.0-20220610221304-9f5ed59c137d
, however running go mod tidy
reverts it back to the version that viper wants, v.0.1.0
.
In this case, am i just unable to use the viper package? Is there anything i can do to still be able to use viper, or any other package that has the same dependencies as nakama?
- Versions: Nakama 3.14.0, Docker, nakama-common v1.25.0
- Server Framework Runtime language (If relevant) Go 1.19
error when using viper:
{"level":"fatal","ts":"2022-11-29T19:17:58.720Z","caller":"main.go:158","msg":"Failed initializing runtime modules","error":"plugin.Open(\"/nakama/data/modules/backend\"): plugin was built with a different version of package golang.org/x/sys/internal/unsafeheader"}