gpt4 book ai didi

linux - 错误消息 "go: go.mod file not found in current directory or any parent directory; see ' go help modules'"

转载 作者:行者123 更新时间:2023-12-04 04:28:02 27 4
gpt4 key购买 nike

我刚刚更新到 Go 的新版本 - Go 版本 1.16.2 Linux/amd64,并且在构建 Hello, World! example 时出现错误:

go: go.mod file not found in current directory or any parent directory; see 'go help modules'


即使我遵循 that post 的修复程序它不工作。我设置了这些变量,然后再次构建:
GO111MODULE=on
GOPROXY=https://proxy.golang.org,direct
不幸的是,同样的问题。

最佳答案

改变这个:go env -w GO111MODULE=auto对此:go env -w GO111MODULE=off

关于linux - 错误消息 "go: go.mod file not found in current directory or any parent directory; see ' go help modules'",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66894200/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com