go get 出错解决方案

2019-06-08

报错

package golang.org/x/mobile/cmd/gomobile: unrecognized import path “golang.org/x/mobile/cmd/gomobile” (https fetch: Get https://golang.org/x/mobile/cmd/gomobile?go-get=1: dial tcp 172.217.11.81:443: i/o timeout)

image

方案一 使用 goproxy.io

for *nix

# Enable the go modules feature
export GO111MODULE=on
# Set the GOPROXY environment variable
export GOPROXY=https://goproxy.io

for win

# Enable the go modules feature
$env:GO111MODULE=on
# Set the GOPROXY environment variable
$env:GOPROXY=https://goproxy.io

设置在 shell配置文件里面 最好 go get ok了

image  

image