问题原因

github.com/eclipse/paho.mqtt.golanghttps://goproxy.io/zh/go get

复现

开启代理后测试

root@tianxi-PC:~# go get github.com/eclipse/paho.mqtt.golang
go get github.com/eclipse/paho.mqtt.golang: module github.com/eclipse/paho.mqtt.golang: Get "https://goproxy.io/github.com/eclipse/paho.mqtt.golang/@v/list": proxyconnect tcp: EOF
root@tianxi-PC:~# 

关闭代理后测试

root@tianxi-PC:~# go get github.com/eclipse/paho.mqtt.golang
# cd .; git clone -- https://github.com/eclipse/paho.mqtt.golang /root/go/src/github.com/eclipse/paho.mqtt.golang
正克隆到 '/root/go/src/github.com/eclipse/paho.mqtt.golang'...
fatal: unable to access 'https://github.com/eclipse/paho.mqtt.golang/': gnutls_handshake() failed: The TLS connection was non-properly terminated.
package github.com/eclipse/paho.mqtt.golang: exit status 128
root@tianxi-PC:~# 

配置

root@tianxi-PC:~# go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://goproxy.io"
GOROOT="/usr/local/go"
GOSUMDB="on"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build524305579=/tmp/go-build -gno-record-gcc-switches"
root@tianxi-PC:~# 
go get