芯が強い人になるESTJ-A

# Golang环境配置MAC,2022 go的天下

IT開発 Tags: 无标签 阅读: 244

Bash

at .bash_profile

# Setting PATH for Python 3.5
# The orginal version is saved in .bash_profile.pysave
#PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"
#export PATH
export GOPATH=$HOME/go
GOROOT=/usr/local/go
export GOROOT
#GOROOT bin
export PATH=$PATH:$GOROOT/bin
#GOPATH bin
export PATH=$PATH:$GOPATH/bin
export PATH="/usr/local/opt/openssl/bin:$PATH"

Zsh

vim .zshrc
#在最下面加入go环境变量即可
#Golang
#export PATH
export GOPATH=$HOME/go
GOROOT=/usr/local/go
export GOROOT
#GOROOT bin
export PATH=$PATH:$GOROOT/bin
#GOPATH bin
export PATH=$PATH:$GOPATH/bin
export PATH="/usr/local/opt/openssl/bin:$PATH"

生效配置

source .zshrc
截屏2021-10-27 09.20.58.jpg