首页 > 系统服务 > 详细

Linux 安装GO开发环境

时间:2017-09-20 00:28:04      阅读:400      评论:0      收藏:0      [点我收藏+]


安装GO开发环境

[root@localhost ~]# yum install golang


GO的Hello world

[root@localhost ~]# cat hello.go 
package main

import (
    "fmt"
)

func main() {
    fmt.Println("Hello world")
}
[root@localhost ~]#


直接运行

[root@localhost ~]# go run hello.go 
Hello world
[root@localhost ~]#




编译成机器码,并运行

[root@localhost ~]# go build  hello.go 
[root@localhost ~]# ./hello 
Hello world
[root@localhost ~]#




本文出自 “李春利” 博客,请务必保留此出处http://990487026.blog.51cto.com/10133282/1966989

Linux 安装GO开发环境

原文:http://990487026.blog.51cto.com/10133282/1966989

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!