Go环境变量

 

go环境变量设置
GOROOT(go的安装目录)
GOPATH(go依赖包目录)

复制代码
# Mac:
vim ~/.zshrc

export GOROOT=/usr/local/go
export GOPATH=/Users/wsongl/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
export GO111MODULE=on
export GOPROXY=https://goproxy.cn,direct

source ~/.zshrc
复制代码

 

复制代码
# Linux:
vim /etc/profile

export GOROOT=/usr/local/go
export GOPATH=/usr/local/go/path
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
export GO111MODULE=on
export GOPROXY=https://goproxy.cn,direct

source /etc/profile
复制代码

 

# Windows 环境变量中设置:
GOROOT: C:\Go
GOPATH: C:\Go\path
GO111MODULE: on
GOPROXY: https://goproxy.cn,direct
Path: %GOROOT%\bin;%GOPATH%\bin

 

.

作者:wsongl

出处:https://www.cnblogs.com/wsongl/p/15944553.html

版权:本作品采用「署名-非商业性使用-相同方式共享 4.0 国际」许可协议进行许可。

靡不有初,鲜克有终

posted @   wsongl  阅读(399)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 一文读懂知识蒸馏
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
点击右上角即可分享
微信分享提示
more_horiz
keyboard_arrow_up dark_mode palette
选择主题