How to set up a go language development environment on mac

王林
Release: 2023-01-11 09:23:19
Original
3366 people have browsed it

How to build a go language development environment on mac: 1. Execute the [brew install go] command to install go; 2. Execute the [go env] command to obtain GOPATH; 3. Execute the [export GOPATH=/xxx] command to modify Just GOPATH.

How to set up a go language development environment on mac

The operating environment of this article: MacOS X system, GO 1.11.2, macbook pro computer.

(Learning video sharing: Programming video)

Specific steps:

The easiest way to install go under mac is through homebrew

Direct execution:

brew update && brew upgrade
brew install go
Copy after login

You need to specify GOPATH after the installation is complete (go does not need to be specified after version 1.8, there will be a default value)

After the go installation is completed, you can Execute go env on the command line to obtain the current GOPATH

The execution results are shown in the figure below:

How to set up a go language development environment on mac

GOPATH can be modified through the following commands

export GOPATH=/xxx/xxx/xxx
Copy after login

At this point, the go development environment is set up.

Related recommendations: golang tutorial

The above is the detailed content of How to set up a go language development environment on mac. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template