Cosmos SDK 不使用新的切片包进行编译

cosmos sdk does not compile with new slices package

提问人:najla chamseddine 提问时间:9/23/2023 更新时间:11/17/2023 访问量:98

问:

在编译 cosmos sdk 项目时,我得到了这个 /root/go/pkg/mod/github.com/cosmos/[email protected]/runtime/services/reflection.go:60:28:键入 func(x *descriptorpb.FileDescriptorProto, y *descriptorpb.FileDescriptorProto) bool of func(x, y *descriptorpb.FileDescriptorProto) bool {...} 与推断类型 func(a *descriptorpb.FileDescriptorProto, b *descriptorpb.FileDescriptorProto) int for func(a E, b E) int

这对切片包来说是 du,因为 sortFunc 现在返回一个 int。 我们怎样才能更换 slices go 包?

你有什么想法吗?

切片 宇宙

评论


答:

1赞 starball 11/9/2023 #1

维护者 Julien Robert 在 issue ticket 中回复 [Bug]: cosmos sdk 0.47.5 does not compile with new go slices package #18415 正是因为 exp 包有 API 更改,他们才没有在 v0.47 中将其提升到新版本。引用他们回复的其余部分:

修补程序版本不得包含任何重大更改。您可以做什么,降级并使用 SDK 中使用的相同版本。另一种解决方案虽然矫枉过正,但升级到包含最新 x/exp 的 v0.50。

那里的另一位用户报告说,他们通过将 go.mod 更改为 go 1.19,删除间接包,然后再次运行来解决这个问题。golang.org/x/expgo mod tidy