gpt4 book ai didi

go - 如何修复 "go get: warning: modules disabled by GO111MODULE=auto in GOPATH/src"

转载 作者:IT王子 更新时间:2023-10-29 01:37:33 27 4
gpt4 key购买 nike

我正在尝试使用以下命令安装 golint:go get -u golang.org/x/lint/golint。我认为我遇到了两个问题:

go get: warning: 
modules disabled by GO111MODULE=auto in GOPATH/src;
ignoring ../go.mod;
see 'go help modules'

package golang.org/x/lint/golint:
unrecognized import path "golang.org/x/lint/golint" (https fetch: Get https://golang.org/x/lint/golint?go-get=1: dial tcp 216.58.200.192:443: i/o timeout)

然后我尝试安装 golang/tools,也失败了...

package golang.org/x/tools: unrecognized import path "golang.org/x/tools" (https fetch: Get https://golang.org/x/tools?go-get=1: dial tcp 216.58.200.192:443: i/o timeout)

最佳答案

我运行了这个命令

export GO111MODULE="on" 

这对我有用...

关于go - 如何修复 "go get: warning: modules disabled by GO111MODULE=auto in GOPATH/src",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56475313/

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