现在区块链项目大多都是用Go语言写的,其实语言都是想通的,如果你其他语言学习的好,那么你学习Go语言起来,也是非常简单的,如果你对区块链比较感兴趣,那么来学学Go也是一点问题都没有的。
访问一下Go语言的官网
Go官网
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Go是一门开源的编程语言,它能够让你更快的编译,更加可靠,编程效率更高。
点击首页的Download Go进入下载页下载Go
选择你的操作系统对应的安装包
/usr/local/go/bin ⌚ 18:13:11
$ ls -l
total 59016
-rwxr-xr-x 1 root wheel 11199852 Mar 29 12:29 go
-rwxr-xr-x 1 root wheel 15608476 Mar 29 12:37 godoc
-rwxr-xr-x 1 root wheel 3403104 Mar 29 12:29 gofmt
/usr/local/go/bin ⌚ 18:13:14
$
package main
import "fmt"
func main() {
fmt.Printf("hello, world\n")
}
~/Block/go/hello ⌚ 18:33:19
$ go build
~/Block/go/hello ⌚ 18:33:44
$ ls
hello hello.go
~/Block/go/hello ⌚ 18:34:40
$
~/Block/go/hello ⌚ 18:36:04
$ ./hello
hello, world
~/Block/go/hello ⌚ 18:36:08
$
~/Block/go/hello ⌚ 18:37:43
$ go version
go version go1.10.1 darwin/amd64
~/Block/go/hello ⌚ 18:37:52
$
~/Block/go/hello ⌚ 19:42:08
$ go clean
~/Block/go/hello ⌚ 19:42:11
$ ls
hello.go
#go
export GOPATH=$HOME/Block/go
~/Block/go ⌚ 18:26:46
$ pwd
/Users/wangdong/Block/go
~/Block/go ⌚ 18:26:48
$
source ~/.bash_profile
export GOPATH=$HOME/go
export GOPATH=$HOME/go
好啦,下面就可以愉快的开始Go语言的学习啦。