您的位置 首页 go错误

A connection attempt failed because the connected party did not properly respond after a period of time,

下边的原因就是 国内的网络问题导致的。解决方案:
终端运行
$ go env -w GO111MODULE=on
$ go env -w GOPROXY=https://goproxy.cn,direct
 
然后重启 VSCODE
 
 
Tools environment: GOPATH=D:\Users\chaoren\go
Installing 7 tools at D:\Users\chaoren\go\bin in module mode.
  gotests
  gomodifytags
  impl
  goplay
  dlv
  staticcheck
  gopls

 

Installing github.com/go-delve/delve/cmd/dlv@latest FAILED
{
 "killed": false,
 "code": 1,
 "signal": null,
 "cmd": "D:\\Program Files\\Go\\bin\\go.exe install -v github.com/go-delve/delve/cmd/dlv@latest",
 "stdout": "",
 "stderr": "go: github.com/go-delve/delve/cmd/dlv@latest: module github.com/go-delve/delve/cmd/dlv: Get \"https://proxy.golang.org/github.com/go-delve/delve/cmd/dlv/@v/list\": dial tcp 142.251.42.241:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.\n"
}
Installing github.com/cweill/gotests/gotests@v1.6.0 FAILED
{
 "killed": false,
 "code": 1,
 "signal": null,
 "cmd": "D:\\Program Files\\Go\\bin\\go.exe install -v github.com/cweill/gotests/gotests@v1.6.0",
 "stdout": "",
 "stderr": "go: github.com/cweill/gotests/gotests@v1.6.0: github.com/cweill/gotests/gotests@v1.6.0: Get \"https://proxy.golang.org/github.com/cweill/gotests/gotests/@v/v1.6.0.info\": dial tcp 142.251.42.241:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.\n"
}
Installing honnef.co/go/tools/cmd/staticcheck@latest FAILED
{
 "killed": false,
 "code": 1,
 "signal": null,
 "cmd": "D:\\Program Files\\Go\\bin\\go.exe install -v honnef.co/go/tools/cmd/staticcheck@latest",
 "stdout": "",
 "stderr": "go: honnef.co/go/tools/cmd/staticcheck@latest: module honnef.co/go/tools/cmd/staticcheck: Get \"https://proxy.golang.org/honnef.co/go/tools/cmd/staticcheck/@v/list\": dial tcp 142.251.42.241:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.\n"
}
Installing github.com/fatih/gomodifytags@v1.16.0 FAILED
{
 "killed": false,
 "code": 1,
 "signal": null,
 "cmd": "D:\\Program Files\\Go\\bin\\go.exe install -v github.com/fatih/gomodifytags@v1.16.0",
 "stdout": "",
 "stderr": "go: github.com/fatih/gomodifytags@v1.16.0: github.com/fatih/gomodifytags@v1.16.0: Get \"https://proxy.golang.org/github.com/fatih/gomodifytags/@v/v1.16.0.info\": dial tcp 142.251.42.241:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.\n"
}
Installing golang.org/x/tools/gopls@latest FAILED
{
 "killed": false,
 "code": 1,
 "signal": null,
 "cmd": "D:\\Program Files\\Go\\bin\\go.exe install -v golang.org/x/tools/gopls@latest",
 "stdout": "",
 "stderr": "go: golang.org/x/tools/gopls@latest: module golang.org/x/tools/gopls: Get \"https://proxy.golang.org/golang.org/x/tools/gopls/@v/list\": dial tcp 142.251.42.241:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.\n"
}

 

欢迎来撩 : 汇总all

白眉大叔

关于白眉大叔linux云计算: 白眉大叔

热门文章