“go mod tidy”之错误“not a valid zip file”
执行 go mod tidy 时,遇到如下错误:
rpc imports
github.com/zeromicro/go-zero/zrpc imports
github.com/zeromicro/go-zero/zrpc/resolver imports
github.com/zeromicro/go-zero/zrpc/resolver/internal imports
k8s.io/client-go/kubernetes imports
k8s.io/client-go/kubernetes/typed/admissionregistration/v1 imports
k8s.io/client-go/applyconfigurations/admissionregistration/v1 imports
k8s.io/client-go/applyconfigurations/meta/v1 imports
k8s.io/kube-openapi/pkg/util/proto tested by
k8s.io/kube-openapi/pkg/util/proto.test imports
github.com/onsi/ginkgo/v2: zip: not a valid zip file
这个错误与 GOPROXY 的设置有关,当如下设置时就报上述错误:
GOPROXY="https://mirrors.aliyun.com/goproxy/,direct"
改为如下设置问题解决:
export GOPROXY="https://goproxy.cn,direct"