安装Beego报错
go get: module github.com/beego/bee/v2: Get "https://proxy.golang.org/github.com/beego/bee/v2/@v/list": dial tcp 172.217.31.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.
解决方法
方法一:设置代理
设置代理地址: goproxy.cn
运行命令即可:
go env -w GOPROXY=https://goproxy.cn
这时候go get 就可以正常下载了
方法二:本地Hosts文件修改
在这个里面去查找下面两个地址的实时IP
github.com 的IP 地址
github.global.ssl.fastly.net 的IP地址
C:\Windows\System32\drivers\etc 在etc里面找到hosts
修改如下:
140.82.114.3 github.com
199.232.5.194 github.global.ssl.fastly.net
再重新执行安装语句就可以成功了。
安装Beego
安装或者升级 Beego 和 Bee 的开发工具:
$ go get -u github.com/beego/beego/v2
$ go get -u github.com/beego/bee/v2
下载的内容
C:\Users\86175>go version
go version go1.16.8 windows/amd64
C:\Users\86175>go get -u github.com/beego/beego/v2
go get: module github.com/beego/beego/v2: Get "https://proxy.golang.org/github.com/beego/beego/v2/@v/list": dial tcp 172.217.160.113: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.
C:\Users\86175>go env -w GOPROXY=https://goproxy.cn
C:\Users\86175>go get -u github.com/beego/beego/v2
go: downloading github.com/beego/beego/v2 v2.0.1
go: downloading github.com/beego/beego v1.12.3
C:\Users\86175>go get -u github.com/beego/bee/v2
go: downloading github.com/beego/bee v1.12.3
go: downloading github.com/beego/bee/v2 v2.0.2
go: downloading gopkg.in/yaml.v2 v2.3.0
go: downloading github.com/fsnotify/fsnotify v1.4.9
go: downloading github.com/go-delve/delve v1.5.0
go: downloading github.com/gorilla/websocket v1.4.2
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/go-sql-driver/mysql v1.5.0
go: downloading github.com/fsnotify/fsnotify v1.5.1
go: downloading github.com/lib/pq v1.7.0
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/go-sql-driver/mysql v1.6.0
go: downloading github.com/flosch/pongo2 v0.0.0-20200529170236-5abacdfa4915
go: downloading github.com/lib/pq v1.10.3
go: downloading github.com/pelletier/go-toml v1.8.1
go: downloading github.com/go-delve/delve v1.7.2
go: downloading github.com/smartwalle/pongo2render v1.0.1
go: downloading github.com/spf13/viper v1.7.0
go: downloading github.com/pelletier/go-toml v1.9.4
go: downloading github.com/spf13/viper v1.9.0
go: downloading github.com/flosch/pongo2 v0.0.0-20200913210552-0d938eb266f3
go: downloading golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f
go: downloading golang.org/x/sys v0.0.0-20211004093028-2c5d950f24ef
go: downloading github.com/hashicorp/hcl v1.0.0
go: downloading github.com/magiconair/properties v1.8.1
go: downloading github.com/mitchellh/mapstructure v1.3.3
go: downloading github.com/spf13/afero v1.1.2
go: downloading github.com/spf13/cast v1.3.0
go: downloading github.com/magiconair/properties v1.8.5
go: downloading github.com/spf13/jwalterweatherman v1.0.0
go: downloading github.com/mitchellh/mapstructure v1.4.2
go: downloading github.com/spf13/pflag v1.0.3
go: downloading github.com/subosito/gotenv v1.2.0
go: downloading github.com/spf13/cast v1.4.1
go: downloading gopkg.in/ini.v1 v1.51.0
go: downloading github.com/spf13/afero v1.6.0
go: downloading github.com/spf13/jwalterweatherman v1.1.0
go: downloading github.com/spf13/pflag v1.0.5
go: downloading gopkg.in/ini.v1 v1.63.2
go: downloading github.com/sirupsen/logrus v1.6.0
go: downloading golang.org/x/text v0.3.3
go: downloading github.com/sirupsen/logrus v1.8.1
go: downloading golang.org/x/text v0.3.7
go: downloading github.com/konsorten/go-windows-terminal-sequences v1.0.3
go: downloading github.com/cosiner/argv v0.1.0
go: downloading github.com/mattn/go-colorable v0.0.9
go: downloading github.com/peterh/liner v1.0.1-0.20171122030339-3681c2a91233
go: downloading github.com/mattn/go-colorable v0.1.11
go: downloading github.com/peterh/liner v1.2.1
go: downloading github.com/hashicorp/golang-lru v0.5.4
go: downloading golang.org/x/arch v0.0.0-20190927153633-4e8777c89be4
go: downloading golang.org/x/arch v0.0.0-20210923205945-b76863e36670
go: downloading github.com/mattn/go-isatty v0.0.3
go: downloading github.com/mattn/go-isatty v0.0.14
go: downloading go.starlark.net v0.0.0-20190702223751-32f345186213
go: downloading go.starlark.net v0.0.0-20210901212718-87f333178d59
go: downloading github.com/derekparker/trie v0.0.0-20200317170641-1fdf38b7b0e9
go: downloading github.com/mattn/go-runewidth v0.0.3
go: downloading github.com/mattn/go-runewidth v0.0.13
go: downloading github.com/aquasecurity/libbpfgo v0.1.2-0.20210708203834-4928d36fafac
go: downloading github.com/aquasecurity/libbpfgo v0.2.1-libbpf-0.4.0
go: downloading github.com/rivo/uniseg v0.2.0
C:\Users\86175>
查看bee的版本
bee version
D:\ProgramProjects\GoProjects\bin>bee version
2021/10/05 23:56:08 INFO ▶ 0001 Getting bee latest version...
2021/10/05 23:56:09 INFO ▶ 0002 Your bee are up to date
______
| ___ \
| |_/ / ___ ___
| ___ \ / _ \ / _ \
| |_/ /| __/| __/
\____/ \___| \___| v2.0.2
├── Beego : Beego is not installed. Please do consider installing it first: https://github.com/beego/beego/v2. If you are using go mod, and you don't install the beego under $GOPATH/src/github.com/astaxie, just ignore this.
├── GoVersion : go1.16.8
├── GOOS : windows
├── GOARCH : amd64
├── NumCPU : 8
├── GOPATH : D:\ProgramProjects\GoProjects
├── GOROOT : D:\Environment\Go
├── Compiler : gc
└── Date : Tuesday, 5 Oct 2021
D:\ProgramProjects\GoProjects\bin>
下载安装beego
go get github.com/astaxie/beego
D:\ProgramProjects\GoProjects\bin>go get github.com/astaxie/beego
go: downloading github.com/prometheus/client_golang v1.7.0
go: downloading golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550
go: downloading gopkg.in/yaml.v2 v2.2.8
go: downloading github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644
go: downloading github.com/prometheus/common v0.10.0
go: downloading github.com/prometheus/client_model v0.2.0
go: downloading github.com/golang/protobuf v1.4.2
go: downloading github.com/cespare/xxhash/v2 v2.1.1
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/prometheus/procfs v0.1.3
go: downloading golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1
go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.1
go: downloading google.golang.org/protobuf v1.23.0
go: downloading golang.org/x/net v0.0.0-20190620200207-3b0461eec859
go: downloading golang.org/x/text v0.3.0