个人安装GO1.13.6版本指南手册之搭建环境
因好奇而走进go语言,让你不在只闻其声,不见其形。
https://golang.org/doc/install;这里是go语言的官网文档。吃不透英文,终究会被限制在有限的区域,一词词的吃透。
安装包下载地址为:https://golang.org/dl/。
如果打不开可以使用这个地址:https://golang.google.cn/dl/。https://golang.google.cn/doc/install。
想了想,具体步骤就不提了,英文内容够全了。
说一下关于SettingGOPATH的中外差别:
就像原文所说,“ If no GOPATH is set, it is assumed to be $HOME/go on Unix systems and %USERPROFILE%\go on Windows.”
那么这个GOPATH居然是在环境变量的用户变量中;
那么,原文中:
Your workspace can be located wherever you like, but we'll use C:\go-work in this example.
NOTE: GOPATH must not be the same path as your Go installation.
- Create folder at
C:\go-work. - Right click on "Start" and click on "Control Panel". Select "System and Security", then click on "System".
- From the menu on the left, select the "Advanced systems settings".
- Click the "Environment Variables" button at the bottom.
- Click "New" from the "User variables" section.
- Type
GOPATHinto the "Variable name" field. - Type
C:\go-workinto the "Variable value" field. - Click OK.
这段就是说将GOPATH这个环境变量的值由原来的%USERPROFILE%\go替换为你的go工作空间的目录。保存环境变量更改后,记得重启电脑是其生效(win10)。
原文中是这样使test.go生效的并测试的:
Check that Go is installed correctly by setting up a workspace and building a simple program, as follows.
Create your workspace directory, %USERPROFILE%\go. (If you'd like to use a different directory, you will need to set the GOPATH environment variable.)
Next, make the directory src\hello inside your workspace, and in that directory create a file named hello.go that looks like:
package main
import "fmt"
func main() {
fmt.Printf("hello, world\n")
}
Then build it with the go tool:
C:\> cd %USERPROFILE%\go\src\hello
C:\Users\Gopher\go\src\hello> go build
The command above will build an executable named hello.exe in the directory alongside your source code. Execute it to see the greeting:
C:\Users\Gopher\go\src\hello> hello
hello, world
If you see the "hello, world" message then your Go installation is working.
You can run go install to install the binary into your workspace's bin directory or go clean -i to remove it.
Before rushing off to write Go code please read the How to Write Go Code document, which describes some essential concepts about using the Go tools.
但是,按旧有方式,还可在终端执行:go run hello.go

使用原文中的生成hello.exe文件得使用当前目录相对路径执行hello.exe这种方式。
更新:
1. 因为go version >= 1.13,所以go env -w GO111MODULE=on修改相应依赖模式,go env查看
个人安装GO1.13.6版本指南手册之搭建环境的更多相关文章
- 【linux】【Go】Centos7安装go1.13环境
前言 Go(又称Golang)是Google开发的一种静态强类型.编译型.并发型,并具有垃圾回收功能的编程语言. 罗伯特·格瑞史莫(Robert Griesemer),罗勃·派克(Rob Pi ...
- centos7.5上安装go1.13.4
一.安装 1.下载go1.13.4.linux-amd64.tar.gz 先进入官网https://golang.google.cn/ 再 https://golang.google.cn/doc/i ...
- 升级安装go1.13.5
运行文件时报错 verifying github.com/mattn/go-isatty@v0.0.10-0.20190818123653-bf9a1dea1961/go.mod: github.co ...
- 黑苹果之DELL台式机安装Mac OS X 10.13.6版本操作系统
由于本人所在的公司一般都是DELL的品牌台式机,所以以DELL台式机做小白鼠.记得在2012年的时候,在当时的那家公司为了学习自学IOS开发的Objective-C开发语言的时候,由于囊中羞涩买不起m ...
- docker探索-CentOS7中配置Docker的yum源并升级安装docker1.13(十)
此处使用的是CentOS7,内核版本为 [root@localhost ~]# uname -r -.el7.x86_64 该版本下,配置了yum的源为阿里的镜像源,具体的配置方法可以参见阿里镜像源配 ...
- Kubernetes 1.13 的完整部署手册
前言: 非常详细的K8s的完整部署手册,由于Kubernetes版本和操作系统的版本关系非常敏感,部署前请查阅版本关系对应表 地址:https://github.com/kubernetes/kube ...
- atitit.api设计 方法 指南 手册 v2 q929.docx
atitit.api设计 方法 指南 手册 v2 q929.docx atitit.api设计原则与方法 1. 归一化(锤子钉子理论)1 1.1. 链式方法2 1.2. 规则5:建立返回值类型2 1. ...
- VMware上安装ubuntu 13.04
作者:viczzx 出处:http://www.cnblogs.com/zixuan-zhang 欢迎转载,也请保留这段声明.谢谢! 这两天打算在Linux环境下学Python语言,想换个高点的ubu ...
- ROS(indigo) 安装和使用更新版本的Gazebo----3,4,5,6,7 附:中国机器人大赛中型组仿真比赛说明
ROS(indigo) 安装和使用更新版本的Gazebo,本文以7为例. Gazebo7支持更多新的功能,如果使用下面命令安装ROS(indigo): ~$ sudo apt-get install ...
随机推荐
- 【SQL必知必会笔记(3)】SELECT语句的WHERE子句数据过滤操作
上个笔记主要介绍了利用SELECT语句检索单个/多个/所有列,并利用DISTINCT关键字检索具有唯一性的值.利用LIMIT/OFFSET子句限制结果:以及利用ORDER BY子句排序检索出的数据,主 ...
- CSS样式表——样式
样式: 1)大小 width:200px; 或width:100%; //样式中要加单位 height:100px; 2)背景 back ...
- UCENTER同步登录工作原理和配置要点
ucenter的同步登录原理: 1)Ucenter是和uc_client同步的.每个PHP应用,加入了UCENTER后,都会在主目录下有个UC_CLIENT目录.这个目录里,都有一个client.PH ...
- 配置vSphere Web Client超时值
1.默认超时值120分钟 2.webclient.properties文件位置: Windows系统:C:\ProgramData\VMware\vCenterServer\cfg\vsphe ...
- 官网英文版学习——RabbitMQ学习笔记(七)Topic
在上一篇中使用直接交换器改进了我们的系统,使得它能够有选择的进行接收消息,但它仍然有局限性——它不能基于多个条件进行路由.本节我们就进行能够基于多个条件进行路由的topics exchange学习. ...
- Python 中 对logging 模块进行封装,记录bug日志、日志等级
是程序产生的日志 程序员自定义设置的 收集器和渠道级别那个高就以那个级别输出 日志和报告的作用: 报告的重点在于执行结果(执行成功失败,多少用例覆盖),返回结果 日志的重点在执行过程当中,异常点,哪里 ...
- 031-PHP获取图像信息
<?php list($width, $height, $type, $attr) = getimagesize("plane.jpg"); echo "宽度为:& ...
- 设置此div的子元素居中显示
下面样式设置到父div上: .modal { display: flex; align-items: center; /*竖直居中 垂直居中*/ justify-content: center; /* ...
- 第一部分 JavaScript语言核心(三)
第六章 对象 P123 在ES3中,点运算符后的标识符不能是保留字.如果一个对象的属性名是保留字,name必须使用方括号的形式访问它们,如o["for"]和o["clas ...
- h5页面列表滚动加载数据
h5列表滚动加载数据很常见,以下分享下今天做的案例: 前言 这个效果实现需要知道三个参数 1. scrollTop -- 滚动条距离顶部的高度 2. scrollHeight -- 当前页面的总高度( ...