GO语言 VSCode开发环境搭建 [Mac]

本文详述了在Mac系统中如何搭建Go语言的开发环境,包括使用Homebrew安装Go,配置Go环境变量(GOROOT, GOPATH, GOBIN),以及在Visual Studio Code(VSCode)中安装和配置Go插件,实现Go项目的开发和调试功能。" 132572799,19671187,R语言:按单个字段降序排序,"['R语言', '数据分析']
摘要由CSDN通过智能技术生成

Go是一个由Google团队和开源社区的许多贡献者开发的开源项目. 本文详细记录了Go开发环境搭建过程,包括Go安装,IDE配置等。

系统环境配置

MacOS High Sierra
版本10.13.5

MacBook Pro (Retina, 15-inch, Mid 2015)
处理器 2.2 GHz Intel Core i7
内存 16 GB 1600 MHz DDR3
图形卡 Intel Iris Pro 1536 MB
一、GO 安装

Go官网提供了可用的Go列表,可以直接下载安装。本文主要采用了homebrew工具进行安装,其优点是简单同时也能够在需要的时候利用homebrew进行升级。(HomeBrew安装教程参见 https://brew.sh/)

zhongxiao.yzx@MacBook-Pro:~/Workspace/ $brew info go

go: stable 1.10.3 (bottled), HEAD
Open source programming language to build simple/reliable/efficient software
https://golang.org
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/go.rb
==> Requirements
Required: macOS >= 10.8 ✔
==> Options
--without-cgo
	Build without cgo (also disables race detector)
--without-race
	Build without race detector
--HEAD
	Install HEAD version
==> Caveats
A valid GOPATH is required to use the `go get` command.
If $GOPATH is not specified, $HOME/go will be used by default:
  https://golang.org/doc/code.html#GOPATH
You may wish to add the GOROOT-based install location to your PATH:
  export PATH=$PATH:/usr/local/opt/go/libexec/bin
zhongxiao.yzx@MacBook-Pro:~/Workspace $brew install go

Updating Homebrew...
warning: unable to access '/Users/zhongxiao.yzx/.config/git/ignore': Permission denied
warning: unable to access '/Users/zhongxiao.yzx/.config/git/attributes': Permission denied
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Renamed Formulae
cdiff -> ydiff
==> Downloading https://homebrew.bintray.com/bottles/go-1.10.3.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring go-1.10.3.high_sierra.bottle.tar.gz
==> Caveats
A valid GOPATH is required to use the `go get` command.
If $GOPATH is not specified, $HOME/go will be used by default:
  https://golang.org/doc/code.html#GOPATH
You may wish to add the GOROOT-based install location to your PATH:
  export PATH=$PA
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值