Gin中文网:https://gin-gonic.com/zh-cn/docs/
1、安装Gin过程中遇到的问题
基本配置如下:
设置了
GOPROXY
https://mirrors.aliyun.com/goproxy/
问题描述:
在命令行中执行
go get -u github.com/gin-gonic/gin
在命令行中未出现异常,
但Goland中出现报错如下:
网络服务异常
go: loading module retractions for github.com/bytedance/sonic@v1.11.6: Get "https://mirrors.aliyun.com/goproxy/github.com/bytedance/sonic/@v/list": Internal Server Error
go: loading module retractions for github.com/bytedance/sonic/loader@v0.1.1: Get "https://mirrors.aliyun.com/goproxy/github.com/bytedance/sonic/loader/@v/list": Internal Server Error
go: loading module retractions for github.com/cloudwego/base64x@v0.1.4: Get "https://mirrors.aliyun.com/goproxy/github.com/cloudwego/base64x/@v/list": Internal Server Error
go: loading module retractions for github.com/cloudwego/iasm@v0.2.0: Get "https://mirrors.aliyun.com/goproxy/github.com/cloudwego/iasm/@v/list": Internal Server Error
go: loading module retractions for github.com/davecgh/go-spew@v1.1.1: Get "https://mirrors.aliyun.com/goproxy/github.com/davecgh/go-spew/@v/list": Internal Server Error
go: loading module retractions for github.com/gabriel-vasile/mimetype@v1.4.3: Get "https://mirrors.aliyun.com/goproxy/github.com/gabriel-vasile/mimetype/@v/list": Internal Server Error
go: loading module retractions for github.com/gin-contrib/sse@v0.1.0: Get "https://mirrors.aliyun.com/goproxy/github.com/gin-contrib/sse/@v/list": Internal Server Error
go: loading module retractions for github.com/gin-gonic/gin@v1.10.0: Get "https://mirrors.aliyun.com/goproxy/github.com/gin-gonic/gin/@v/list": Internal Server Error
go: loading module retractions for github.com/go-playground/assert/v2@v2.2.0: Get "https://mirrors.aliyun.com/goproxy/github.com/go-playground/assert/v2/@v/list": Internal Server Error
go: loading module retractions for github.com/go-playground/locales@v0.14.1: Get "https://mirrors.aliyun.com/goproxy/github.com/go-playground/locales/@v/list": Internal Server Error
go: loading module retractions for github.com/go-playground/universal-translator@v0.18.1: Get "https://mirrors.aliyun.com/goproxy/github.com/go-playground/universal-translator/@v/list": Internal Server Error
go: loading module retractions for github.com/go-playground/validator/v10@v10.20.0: Get "https://mirrors.aliyun.com/goproxy/github.com/go-playground/validator/v10/@v/list": Internal Server Error
go: loading module retractions for github.com/goccy/go-json@v0.10.2: Get "https://mirrors.aliyun.com/goproxy/github.com/goccy/go-json/@v/list": Internal Server Error
go: loading module retractions for github.com/golang/protobuf@v1.5.0: Get "https://mirrors.aliyun.com/goproxy/github.com/golang/protobuf/@v/list": Internal Server Error
go: loading module retractions for github.com/google/go-cmp@v0.5.5: Get "https://mirrors.aliyun.com/goproxy/github.com/google/go-cmp/@v/list": Internal Server Error
go: loading module retractions for github.com/google/gofuzz@v1.0.0: Get "https://mirrors.aliyun.com/goproxy/github.com/google/gofuzz/@v/list": Internal Server Error
go: loading module retractions for github.com/json-iterator/go@v1.1.12: Get "https://mirrors.aliyun.com/goproxy/github.com/json-iterator/go/@v/list": Internal Server Error
go: loading module retractions for github.com/klauspost/cpuid/v2@v2.2.7: Get "https://mirrors.aliyun.com/goproxy/github.com/klauspost/cpuid/v2/@v/list": Internal Server Error
go: loading module retractions for github.com/knz/go-libedit@v1.10.1: Get "https://mirrors.aliyun.com/goproxy/github.com/knz/go-libedit/@v/list": Internal Server Error
go: loading module retractions for github.com/leodido/go-urn@v1.4.0: Get "https://mirrors.aliyun.com/goproxy/github.com/leodido/go-urn/@v/list": Internal Server Error
go: loading module retractions for github.com/mattn/go-isatty@v0.0.20: Get "https://mirrors.aliyun.com/goproxy/github.com/mattn/go-isatty/@v/list": Internal Server Error
go: loading module retractions for github.com/modern-go/concurrent@v0.0.0-20180306012644-bacd9c7ef1dd: Get "https://mirrors.aliyun.com/goproxy/github.com/modern-go/concurrent/@v/list": Internal Server Error
go: loading module retractions for github.com/modern-go/reflect2@v1.0.2: Get "https://mirrors.aliyun.com/goproxy/github.com/modern-go/reflect2/@v/list": Internal Server Error
go: loading module retractions for github.com/pelletier/go-toml/v2@v2.2.2: Get "https://mirrors.aliyun.com/goproxy/github.com/pelletier/go-toml/v2/@v/list": Internal Server Error
go: loading module retractions for github.com/pmezard/go-difflib@v1.0.0: Get "https://mirrors.aliyun.com/goproxy/github.com/pmezard/go-difflib/@v/list": Internal Server Error
go: loading module retractions for github.com/stretchr/objx@v0.5.2: Get "https://mirrors.aliyun.com/goproxy/github.com/stretchr/objx/@v/list": Internal Server Error
go: loading module retractions for github.com/stretchr/testify@v1.9.0: Get "https://mirrors.aliyun.com/goproxy/github.com/stretchr/testify/@v/list": Internal Server Error
go: loading module retractions for github.com/twitchyliquid64/golang-asm@v0.15.1: Get "https://mirrors.aliyun.com/goproxy/github.com/twitchyliquid64/golang-asm/@v/list": Internal Server Error
go: loading module retractions for github.com/ugorji/go/codec@v1.2.12: Get "https://mirrors.aliyun.com/goproxy/github.com/ugorji/go/codec/@v/list": Internal Server Error
go: loading module retractions for golang.org/x/arch@v0.8.0: Get "https://mirrors.aliyun.com/goproxy/golang.org/x/arch/@v/list": Internal Server Error
go: loading module retractions for golang.org/x/crypto@v0.23.0: Get "https://mirrors.aliyun.com/goproxy/golang.org/x/crypto/@v/list": Internal Server Error
go: loading module retractions for golang.org/x/mod@v0.8.0: Get "https://mirrors.aliyun.com/goproxy/golang.org/x/mod/@v/list": Internal Server Error
go: loading module retractions for golang.org/x/net@v0.25.0: Get "https://mirrors.aliyun.com/goproxy/golang.org/x/net/@v/list": Internal Server Error
go: loading module retractions for golang.org/x/sys@v0.20.0: Get "https://mirrors.aliyun.com/goproxy/golang.org/x/sys/@v/list": Internal Server Error
go: loading module retractions for golang.org/x/term@v0.20.0: Get "https://mirrors.aliyun.com/goproxy/golang.org/x/term/@v/list": Internal Server Error
go: loading module retractions for golang.org/x/text@v0.15.0: Get "https://mirrors.aliyun.com/goproxy/golang.org/x/text/@v/list": Internal Server Error
go: loading module retractions for golang.org/x/tools@v0.6.0: Get "https://mirrors.aliyun.com/goproxy/golang.org/x/tools/@v/list": Internal Server Error
go: loading module retractions for golang.org/x/xerrors@v0.0.0-20191204190536-9bdfabe68543: Get "https://mirrors.aliyun.com/goproxy/golang.org/x/xerrors/@v/list": Internal Server Error
go: loading module retractions for google.golang.org/protobuf@v1.34.1: Get "https://mirrors.aliyun.com/goproxy/google.golang.org/protobuf/@v/list": Internal Server Error
go: loading module retractions for gopkg.in/check.v1@v0.0.0-20161208181325-20d25e280405: Get "https://mirrors.aliyun.com/goproxy/gopkg.in/check.v1/@v/list": Internal Server Error
go: loading module retractions for gopkg.in/yaml.v3@v3.0.1: Get "https://mirrors.aliyun.com/goproxy/gopkg.in/yaml.v3/@v/list": Internal Server Error
go: loading module retractions for nullprogram.com/x/optparse@v1.0.0: Get "https://mirrors.aliyun.com/goproxy/nullprogram.com/x/optparse/@v/list": Internal Server Error
go: loading module retractions for rsc.io/pdf@v0.1.1: Get "https://mirrors.aliyun.com/goproxy/rsc.io/pdf/@v/list": Internal Server Error
go.mod中内容如下:
依赖不可用状态
解决:
命令行中未出现异常,说明 本机与配置的阿里云代理库之间连接正常
但Goland中出现网络异常,依赖加载失败。
配置Goland的网络连接后,重启一下
问题解决,依赖完成下载
另外,如下图,如果require中爆红
可排查是否配置GPROXY环境!