首页Go文章详情

【已解决】go包管理代理地址: https://proxy.golang.org 在国内无法访问的问题

By lakeui / Aug 8, 2020 阅读 0 评论 0 发表于 Go 字数:85 阅读时间:1秒

gogin

摘要:go get: module github.com/gin-gonic/gin: Get "https://proxy.golang.org/github.com/gin-gonic/gin/@v/list": dial tcp 172.217.24.17:443: i/o timeout

gin 框架的安装

  1. go get -u github.com/gin-gonic/gin

出现报错:
go get: module github.com/gin-gonic/gin: Get “@v/list"">https://proxy.golang.org/github.com/gin-gonic/gin/@v/list“: dial tcp 172.217.24.17:443 : i/o timeout

原因分析

默认使用的是proxy.golang.org,在国内无法访问

解决方案

换一个国内能访问的代理地址:https://goproxy.cn
执行命令:

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

重新执行gin安装命令,可以安装成功!

手机扫码阅读,舒服~

⌘ + Return 发表
最新 最早 全部评论0 条评论