我从GitHub安装了一个Go程序,当我运行它时,我得到了错误,
panic: Something in this program imports go4.org/unsafe/assume-no-moving-gc to declare that it assumes a non-moving garbage collector, but your version of go4.org/unsafe/assume-no-moving-gc hasn't been updated to assert that it's safe against the go1.18 runtime. If you want to risk it, run with environment variable ASSUME_NO_MOVING_GC_UNSAFE_RISK_IT_WITH=go1.18 set. Notably, if go1.18 adds a moving garbage collector, this program is unsafe to use.似乎与此相关的信息并不多。我对围棋没有编码经验。
任何帮助都是非常感谢的。我很乐意提供你可能需要的任何额外信息。
PS:我安装的程序是metabignor,它是用go install github.com/j3ssie/metabigor@latest安装的。
发布于 2022-05-02 13:56:30
您还可以通过使用assume-no-moving-gc来解决这个问题来升级go get -u go4.org/unsafe/assume-no-moving-gc。
发布于 2022-04-20 15:41:35
您导入的库会触发恐慌错误。
https://github.com/go4org/unsafe-assume-no-moving-gc/blob/main/untested.go
func init() {
dots := strings.SplitN(runtime.Version(), ".", 3)
v := runtime.Version()
if len(dots) >= 2 {
v = dots[0] + "." + dots[1]
}
if os.Getenv(env) == v {
return
}
panic("Something in this program imports go4.org/unsafe/assume-no-moving-gc to declare that it assumes a non-moving garbage collector, but your version of go4.org/unsafe/assume-no-moving-gc hasn't been updated to assert that it's safe against the " + v + " runtime. If you want to risk it, run with environment variable " + env + "=" + v + " set. Notably, if " + v + " adds a moving garbage collector, this program is unsafe to use.")
}正如错误所说的,您需要设置这个env var。
ASSUME_NO_MOVING_GC_UNSAFE_RISK_IT_WITH=go1.18或者,将go运行时升级到go1.19
https://stackoverflow.com/questions/71942328
复制相似问题