centos 安装go

作者: 响呼雷 | 来源:发表于2019-03-17 11:30 被阅读1次

下载go并解压

wget https://studygolang.com/dl/golang/go1.10.1.linux-amd64.tar.gztar -xvf go1.10.1.linux-amd64.tar.gz

设置环境变量

nano /etc/profile

添加

export GOROOT=/data/work/go //解压go的目录
export GOPATH=/data/work/gowork //工作目录
export PATH=PATH:GOROOT/bin:$GOPATH/bin

重启启动

source /etc/profile

创建目录 /data/work/gowork

nano hello.go

输入

package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}

执行

go run hello.go

输出

Hello, World!

相关文章

  • linux系统安装go环境

    centos 安装 go 环境 环境与软件包名称 系统环境: centos7.5go软件包: go1.17....

  • singularity

    singularity 安装 安装依赖 在ubuntu上 在centos上 安装Go Singularity 3....

  • Cue相关

    安装 系统:centos 安装golang 安装cueGo设置 go get 为国内源 - ChnMig - 博客...

  • Gogs部署

    1 go lang安装配置 1.1 centos go lang install yum install merc...

  • goaccess 安装记录

    centos6.8安装centos,使用yum:yum install goaccess 如果你的yum找不到go...

  • Golang Notes

    Go 语言环境安装 下载安装包 https://golang.google.cn/dl/ CentOS安装为例: ...

  • GO与Centos7部署

    GO环境搭建(下载、解压、添加环境变量、查看Go版本) 参考:CentOS7.6 源码安装 go1.13.12 G...

  • go语言开发工具分享

    google的go语言分析诊断工具 centos先安装gops gops —— Go 程序诊断分析工具[https...

  • 安装kingshard

    一、安装go 1、CentOS7安装go语言环境 2、查看版本 3、设置环境变量在/etc/profile中添加G...

  • Centos安装go

    一: 编译版本安装英文版本:https://golang.org/doc/install#install

网友评论

    本文标题:centos 安装go

    本文链接:https://www.haomeiwen.com/subject/acoymqtx.html