Mac installation go environment construction tutorial

Download go SDK

下载地址:go.dev

insert image description here

Install the SDK

insert image description here

insert image description here

Check if the installation is complete

go version

insert image description here
The installation is complete

Environment configuration

Open the terminal and enter: vim ~/.zshrc and press ito enter vim to edit this file

Add the following configuration

# 自己的项目路径
export GOPATH=/Users/wuzhenyong/work_ws/project/go_ws  
# go的运行目录
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN

insert image description here

Exit and save when done

Execute source ~/.zshrc the command to make the modified configuration take effect

Enter go envcheck configuration

insert image description here

That's all

Guess you like

Origin blog.csdn.net/A_yonga/article/details/127850901
Recommended