目录

  1. 1. 前言
  2. 2. Question
  3. 3. Answer

LOADING

第一次加载文章图片可能会花费较长时间

要不挂个梯子试试?(x

加载过慢请开启缓存 浏览器默认开启

go依赖安装报错

2023/10/18 Q&A Golang
  |     |   总文章阅读量:

前言

参考文章:https://blog.csdn.net/qq_37767455/article/details/121188740


Question

vscode安装dlv依赖时报错:

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 ***.\*\*\*.\*\*\*.\*\*\*:port: 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.

Answer

  1. 查看 GOSUMDB 的配置

    go env

    image-20231018165708766

    找到set GOSUMDB=sum.golang.org

  2. 关掉GOSUMDB

    go env -w GOSUMDB=off
  3. 配置代理

    go env -w GOPROXY=https://goproxy.cn,direct

再次安装依赖,成功