Golang 的安装

栏目: Go · 发布时间: 7年前

使用命令:

下载

wget https://studygolang.com/dl/golang/go1.10.4.linux-amd64.tar.gz

解压缩,并移动到 /usr/local 目录下

sudo tar -C /usr/local -xzf go1.10.4.linux-amd64.tar.gz

编辑当前用户环境变量

sudo vim ~./.profile

添加 GOROOT GOPATH 环境变量

export GOROOT=/usr/local/go

export GOPATH=$HOME/gopath

export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

需要把添加的环境变量载入

source ~/.profile

因为我们设置当前用户的文件夹下的 gopath 目录为 GOPATH 目录,所以需要建立 gopath 目录,并且在 gopath 目录下建立 bin pkg src  目录。


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

C++ How to Program (5th Edition) (How to Program)

C++ How to Program (5th Edition) (How to Program)

Harvey & Paul) Deitel & Associates / Prentice Hall / 2005-01-05 / USD 98.00

With over 250,000 sold, Harvey and Paul Deitel's C++ How to Program is the world's best-selling introduction to C++ programming. Now, this classic has been thoroughly updated! The Deitels' groundbreak......一起来看看 《C++ How to Program (5th Edition) (How to Program)》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试