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:\Go
Ensure the Go binaries (found in
C:\Go\bin
) are in yourPath
system environment variables. To check clickSystem
,Advanced system settings
,Environment Variables...
and openPath
underSystem 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\Go
folder 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
GOPATH
and 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环境呢? 首先,你需要有安装包,这个去官网下载就可以了,如果不会的话,可以看文章底部 ...
随机推荐
- 秒杀系统-DAO
DAO(Data Access Object) 数据访问对象 首先需要创建秒杀库存表和秒杀成功明细表,如下所示: CREATE DATABASE seckill; use seckill; CREAT ...
- 移植U-Boot时遇到的问题
1. 在lowlevel_init过程中,本来想实现一个串口直接打印字符串的过程,编译的时候出现了问题,说是发现代码执行段没有对齐:“unaligned opcodes detected in exe ...
- 端口转发工具lcx使用两类
lcx是一款强大的内网端口转发工具,用于将内网主机开放的内部端口映射到外网主机(有公网IP)任意端口.它是一款命令行工具,当然也可以在有权限的webshell下执行,正因如此lcx常被认为是一款黑客入 ...
- Hadoop 综合揭秘——HBase的原理与应用
前言 现今互联网科技发展日新月异,大数据.云计算.人工智能等技术已经成为前瞻性产品,海量数据和超高并发让传统的 Web2.0 网站有点力不从心,暴露了很多难以克服的问题.为此,Google.Amazo ...
- [UWP]实现一个轻量级的应用内消息通知控件
在UWP应用开发中,我们常常有向用户发送一些提示性消息的需求.这种时候我们一般会选择MessageDialog.ContentDialog或者ToastNotification来完成功能. 但是,我们 ...
- 移动端IM开发者必读(二):史上最全移动弱网络优化方法总结
1.前言 本文接上篇<移动端IM开发者必读(一):通俗易懂,理解移动网络的“弱”和“慢”>,关于移动网络的主要特性,在上篇中已进行过详细地阐述,本文将针对上篇中提到的特性,结合我们的实践经 ...
- ssh命令-使用密钥文件进行登陆
在win上面可以使用XSHELL来登录类似于阿里云这样的安全服务器,在ubuntu上面就可以使用系统自带的命令工具来连接 使用命令 ssh -i key.pem [server] 实例如下: ssh ...
- Appium发送中文或其他语言的问题
1. 需要在配置信息中增加'unicodeKeyboard' = “True”字段,如下: def driver_weixin(platformVersion="6.0.1",de ...
- 6个免费的C++图形和游戏库
继上一篇,本篇同样出自zoomzum.com,具体可见http://zoomzum.com/6-free-c-graphics-and-game-libraries/,介绍了6个免费的C++图形和游戏 ...
- linux中变量的一些操作方法
常见的一般有如下操作,可以对字符串进行简单操作: echo ${#var}打印变量var长度 echo "$var:3:8" 打印变量var第4个字符开始的8个字符echo ${v ...