解决办法: 使用go env -w go env -w GOPROXY="https://goproxy.cn,direct" 而不是 ~ 而不是 ~ 而不是 " go env" 这样设置完以后不管是关闭还是切换窗口(我用的xshell)都是好使的,亲测