Install go1.5 for CentOS7
https://golang.org/doc/install
下载好后,通过FTPS,传递到Linux里去,放哪里随便你自己,因为被墙了,所以在Windows通过旋风下载了这个玩意儿。
你也可以:
wget https://storage.googleapis.com/golang/go1.5.linux-amd64.tar.gz //将go解压到/opt,个人喜好罢了
[root@localhost ~]# tar -C /opt -xzf ./go1.5.linux-amd64.tar.gz /*在末尾增加一下两行,
GOPATH是工作目录,
GOROOT表示指出go的根目录位置 ps:在自定义程序的安装位置后,需要设置这个
export GOROOT=/opt/go
export PATH=$PATH:$GOROOT/bin
export GOPATH=$HOME/goTest
*/
[root@localhost ~]# vim /etc/profile [root@localhost ~]# source /etc/profile [root@localhost ~]# mkdir ./goTest/src/test [root@localhost test]# touch ./hello.go 写入内容到hello.go:
package main import "fmt" func main() {
fmt.Printf("hello, world\n")
} [root@localhost src]# cd .. //出现这个错误了,叫我们设置一个.go文件安装后,生成的可执行二进制文件存储在哪个目录,这个通过GOBIN设置地址,
export GOBIN=$GOPATH/bin把这段写到/etc/profile的后面去吧。
[root@localhost src]# go install test/hello.go
go install: no install location for .go files listed on command line (GOBIN not set) [root@localhost src]# source /etc/profile [root@localhost src]# go install test/hello.go
[root@localhost src]# $GOBIN/hello
hello, world 到这里,你的go就算安装好了。

Install go1.5 for CentOS7的更多相关文章
- How to install OpenBazaar Server in CentOS7
helps from: https://github.com/OpenBazaar/OpenBazaar-Server http://stackoverflow.com/questions/24917 ...
- How to install Shadow•socks in CentOS7
Helps from: http://www.cmsky.com/shadowsocks-python-install/ http://shadowsocks.blogspot.jp/?m=1 wge ...
- CentOS7 安装Mono及Jexus
CentOS7安装Mono及Juxes 1 安装Mono 1.1 安装yum-utils 因为安装要用到yum-config-manager,默认是没有安装的,所以要先安装yum-utils包.命令如 ...
- 将centos7打造成桌面系统
前言以下所有操作默认在root权限下执行,桌面环境是kde,使用gnome的也可以参考一下.我收集的以下要用到的一些安装包,360网盘http://yunpan.cn/csMhBAp92vTgN 提取 ...
- 基于 CentOS7 的 Kubernetes 集群
一.环境 相关主机 master 192.168.12.197 minion 192.168.12.198~232 etcd 192.168.12.233~236 相关软件 OS CentOS 7 软 ...
- jumpserver V0.4.0 在CentOs7上的安装
基于 CentOS 7 一步一步安装 Jumpserver 0.4.0 环境 系统: CentOS 7 IP: 192.168.226.128 一. 准备Python3和Python虚拟环境 1.1 ...
- Centos7新功能
Centos7 单用户模式 centos7里不再有0-6启动级别,而是4个target graphical.target 多人模式,支持图形和命令行两种登录,对应之前的3,5级别 mul ...
- CentOS7中关闭firewall,并使用iptables管理防火墙
背景描述 在使用Docker时,启用centos7默认的firewall,启动端口映射时,防火墙规则不生效.docker默认使用了iptables防火墙机制.所以需要关闭firewall使用iptab ...
- docker 在centos6 和centos7上的区别
这些天研究了下docker,在centos6.6上装了个docker1.7.1,在centos7.6上装了个docker18.09.0 两者还是有区别的. 1.配置docker国内镜像加速 Dock ...
随机推荐
- 解决GPU显存未释放问题
前言 今早我想用多块GPU测试模型,于是就用了PyTorch里的torch.nn.parallel.DistributedDataParallel来支持用多块GPU的同时使用(下面简称其为Dist). ...
- css 动画 transition和animation
本文参考:http://www.ruanyifeng.com/blog/2014/02/css_transition_and_animation.html 1. transition基本用法: < ...
- dp例题02. 滑雪问题 (poj1088)
poj1088滑雪问题 题目链接:http://poj.org/status Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激.可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得 ...
- 求组合数m_n
下面为求取组合数的代码: #include <stdio.h> #define MAX 10009 ]; void print(int *v, int length) { ; for (; ...
- Math常用方法
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>& ...
- 关于C#三层架构增删改查中的“查询”问题
序:问题总是反复出现,可能只是一个小小的问题,但是就像肉中刺. 问题: 关于“姓名”字段的拼接问题 姓名字段的拼接:this.Repeater1.DataSource = db.GetList(&qu ...
- python:爬取博主的所有文章的链接、标题和内容
以爬取我自己的博客为例:https://www.cnblogs.com/Mr-choa/ 1.获取所有的文章的链接: 博客文章总共占两页,比如打开第一页:https://www.cnblogs.com ...
- ACL,NAT的使用
项目练习 练习一: 练习目的:通过配置路由器的dhcp功能使pc自动获取ip地址. Router>enable Router#configure terminal Router(config) ...
- 一分钟搞定Java高频面试题
一分钟搞定Java高频面试题 一.变量赋值和计算 题目: public static void main(String[] args) { int i = 1; i = i++; int j = i+ ...
- 在写微信小程序如何 首次编译的是当前写的页面
首先点击顶部的编译如下图 染后点击添加模式哈 选择页面加载是启动的是哪一个页面