5步搭建GO环境
Easy Go Programming Setup for Windows
Dec 23, 2014
I’ve had to do this more than once recently, so I figured I’d document the simple steps for setting up the Go programming language on Windows. Most of this is simple and straightforward. The only tricky part I found is setting up your GOPATH, which defines a convention for storing and building Go code you write and acquire from open source code repositories.
5 Simple Steps
Follow these five simple steps to install Go.
Make sure you have both Git download and Mercurial download installed. With Go programming you’ll make heavy use of open source repositories.
Download and install the latest 64-bit Go MSI distributable (which sets most of the environmental variables for you). https://golang.org/dl/

To make things simple, use the default installation path at
C:\GoEnsure the Go binaries (found in
C:\Go\bin) are in yourPathsystem environment variables. To check clickSystem,Advanced system settings,Environment Variables...and openPathunderSystem variables:
An easy way to confirm is to open the command line and type
go version:
Setup your Go workspace. This consists of three folders at the root:
bin/
pkg/
src/
I create a
C:\Projects\Gofolder as my root Go workspace:
Create the GOPATH environment variable and reference your Go workspace path. To add, click
System,Advanced system settings,Environment Variables...and clickNew...underSystem variables:
Set the variable name to
GOPATHand value to your Go workspace path (e.g.C:\Projects\Go):
You can quickly check to ensure your path has been set by opening the command line and typing
echo %GOPATH%and check the output:
And that’s all it takes! You’re ready to get started.
Verify
Want to quickly test and ensure this is all working as expected? Open the command line and type the following:
go get github.com/golang/example/hello
%GOPATH%/bin/hello
You should see the output as “Hello, Go examples!” (refreshingly, not your typical hello world):

I hope this helps!
5步搭建GO环境的更多相关文章
- 一步一步搭建Jenkins环境
Jenkins使用经验谈1(一步一步搭建Jenkins环境)在公司使用 Jenkins 软件已经有一段时间了,走了很多弯路,但也积累了一些经验,可以和大家分享一下.我们来一起搭建Jenkins环境.首 ...
- 带你一步一步搭建TypeScript环境
今天继续来更新,本篇文章我们讲环境搭建,主要分享一些环境搭建的学习资源及安装步骤,解决一些安装时可能会出现的问题.下面就让我们一起进入学习第一步,搭建TypeScript环境:一. 环境搭建1.1. ...
- CentOS7上LNMP安装包一步搭建LNMP环境
系统需求: CentOS/RHEL/Fedora/Debian/Ubuntu/Raspbian Linux系统 需要5GB以上硬盘剩余空间 需要128MB以上内存(如果为128MB的小内存VPS,Xe ...
- 深入浅出Docker(五):基于Fig搭建开发环境
概述 在搭建开发环境时,我们都希望搭建过程能够简单,并且一劳永逸,其他的同事可以复用已经搭建好的开发环境以节省开发时间.而在搭建开发环境时,我们经常会被复杂的配置以及重复的下载安装所困扰.在Docke ...
- [ALM]一步一步搭建MS ALM环境 - 安装TFS + SQL SERVER
描述: 安装SQL SERVER 2012,安装TFS 2013,配置TFS,挽起袖子,准备干活儿 步骤: 1,打开Hyper-V Manager,参考[Hyper-V]使用操作系统模板创建新的虚拟机 ...
- ubuntu16.04下Hyperledger之搭建Fabric环境简单操作(五步启动e2e_cli)
如果你已经安装好go等工具.git及checkout相关代及下载相关镜像,您只需下面5步就能up e2e_cli~/go/src/github.com/hyperledger/fabric$ sudo ...
- 一步一步搭建oracle 11gR2 rac+dg之环境准备(二)【转】
一步一步在RHEL6.5+VMware Workstation 10上搭建 oracle 11gR2 rac + dg 之环境准备 (二) 一步一步搭建oracle 11gR2 rac+dg之环境准备 ...
- vscode加MinGw三步搭建c/c++调试环境
vscode加MinGw三步搭建c/c++调试环境 step1:安装vscode.MinGw 1.1 vscod常规安装:https://code.visualstudio.com/ 1.2 MinG ...
- 怎么搭建python环境?很简单,就几步的事
现在学习python的人越来越多了,而学习python必备的就是搭建python环境,那么,到底怎么搭建python环境呢? 首先,你需要有安装包,这个去官网下载就可以了,如果不会的话,可以看文章底部 ...
随机推荐
- var
在函数中,使用var声明的变量,为局部变量,只能在函数内部访问. 不使用var声明的变量,为全局变量,在函数外边也能访问. 没有var的情况 <script type="text/ja ...
- 2019.02.11 bzoj4818: [Sdoi2017]序列计数(矩阵快速幂优化dp)
传送门 题意简述:问有多少长度为n的序列,序列中的数都是不超过m的正整数,而且这n个数的和是p的倍数,且其中至少有一个数是质数,答案对201704082017040820170408取模(n≤1e9, ...
- CSS Grid
效果图如上所示 <!DOCTYPE html> <html> <head> <title>练习</title> </head> ...
- 准备在electron上用vue,结果卡在了sqlite3
vue.js看书有一段时间了,也准备动手做一个electron的程序.目录似乎有两种方式搭建方式 一种是使用vue.cli构建工具,就是所谓的脚手架,分别安装vue和electron https:// ...
- Axure RP Xmind
官方网站下载地址:http://www.axure.com/download 下载地址:http://www.iaxure.com/2941.html 汉化安装:http://www.iaxure.c ...
- 利用IP核设计高性能的计数器
利用Quartus II的LPM_counter IP核进行设计(利用IP核设计可以迅速高效的完成产品的设计) 新建工程 调用IP核 创建一个新的IP核 选择LMP_COUNTER,语言类型,输出路径 ...
- 利用ADO打开Access数据(64位系统)
64位的access一定要用64的程序才能正确打开,仍然用"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Test.accdb;Persist ...
- 在源文件(.c)和头文件(.h)中声明和定义的区别——C语言
最近在看多文件编程的时候遇到的一个问题,本来以为理解了声明和定义的区别(然而并没有····),也算是重新认识了一次声明和定义,下面上代码 情形一:在源文件(.c)中 相信大部分读者对声明和定义的理解是 ...
- CURL超时时间设置
一次完整的http请求,一般包含三个步骤: 通过DNS把域名解析成IP 通过IP地址连接到目标主机 获取目标主机数据(1.给目标主机输出http请求头,以\r\n\r\n结尾:2.获取目标主机传过来的 ...
- ie被hao.360劫持的解决方法
概述 之前无意中发现ie被hao.360劫持了,只要打开网址就会跳到hao.360,然后显示网络错误.网上试了几种解决方法,都不行,最后被我用重置ie浏览器的方法解决了.我总结了一下,把各种方案都记下 ...