美文网首页
第一个GO语言 so Easy

第一个GO语言 so Easy

作者: 释_远 | 来源:发表于2017-09-17 19:12 被阅读0次

学习网址http://www.runoob.com/go/go-structures.html

1 .下载按转包 go1.7.darwin-amd64.pkg

2  修改 open -e .bash_profile 文件

export GOPATH=/Users/username/Go

export GOBIN=$GOPATH/bin

export PATH=$PATH:$GOBIN

3 通过subline 编写第一个go程序

cd /Users/username/go

mkdir src pkg bin main

cd main

目录

程序如 : test.go

package main

import "fmt"

func main() {

fmt.Printf("这是我的第一个Go 程序 Hello, world ")

}

4. 执行 go run  xx.go

5. 结果 这是我的第一个Go 程序 Hello, world 

相关文章

网友评论

      本文标题:第一个GO语言 so Easy

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