北仑网站推广,用c 做网站,外发加工网灯饰,wordpress论坛用户文章目录 前言Linux的设置Windlows设置Go version 1.13 当你的GO的版本大于1.13的时候 Set environment variable allow bypassing the proxy for selected modules 前言
在进行Go开发的时候#xff0c;设置Go的环境变量信息是必须的。下面介绍windows和Linux#xff0… 文章目录 前言Linux的设置Windlows设置Go version 1.13 当你的GO的版本大于1.13的时候 Set environment variable allow bypassing the proxy for selected modules 前言
在进行Go开发的时候设置Go的环境变量信息是必须的。下面介绍windows和Linux以及Go自身提供的命令进行设置的形式
Linux的设置
In Linux or macOS, you can execute the below commands.(在Linux或者macOS你可以执行下面的命令)
# Enable the go modules feature
export GO111MODULEon
# Set the GOPROXY environment variable
export GOPROXYhttps://goproxy.io但是这种有个不好的地方就是如果换一个终端或者重新开机就没有了。那么我推荐在/etc/profile.d/这个文件夹下面写一个
go.sh文件把上面两句抄上就行。当然你也可以只给自己当前的登录用户使用那就设置自己的profile的加载.
那就是这俩文件.bashrc或者.bash_profile文件(Or, write it into the .bashrc or .bash_profile file.)Windlows设置
In Windows, you can execute the below commands.(在Windlows中你可以执行下面的命令)
# Enable the go modules feature
$env:GO111MODULEon
# Set the GOPROXY environment variable
$env:GOPROXYhttps://goproxy.io注意不过我还是建议使用我的电脑--属性---环境变量 这种操作来进行配置Go version 1.13 当你的GO的版本大于1.13的时候
当你安装的GO的语言版本大于1.13的时候那么就不用这么麻烦了直接使用go env -w命令就行了 go env -w GOPROXYhttps://goproxy.io,direct
Set environment variable allow bypassing the proxy for selected modules
go env -w GOPRIVATE*.corp.example.com
go env -w GO111MODULEon这个我试过即使你关闭了终端新打开还是可以的这个命令比较的无伤害.