学习资料:
go官方教程:
go是google公司开发的语言.
Tutorial: Get started with Go:https://golang.google.cn/doc/tutorial/getting-started
Tutorials:https://golang.google.cn/doc/tutorial/
golang官网:
https://tour.golang.org/
https://golang.org/doc/effective_go.html
《The Go Programming Language》
该书被誉为:Go语言圣经
官网:http://www.gopl.io/
《Go程序设计语言》
《The Go Programming Language》的中文版
网址:https://flydk.gitbooks.io/go/content
https://www.kancloud.cn/hartnett/gopl-zh/126048
https://www.jishuchi.com/read/gopl/752
《Go by Example》
Go by Example 英文版:https://gobyexample.com/
Go by Example 中文版:https://gobyexample-cn.github.io/
在线编写Go
Go下载与安装(windows版本)
下载:
https://golang.google.cn/doc/install?download=go1.16.windows-amd64.msi
Go官方教程:
Tutorial: Get started with Go:https://golang.google.cn/doc/tutorial/getting-started
IDE工具
GoLand:https://www.jetbrains.com/go/
常见异常
cannot run non-main package
go run helloworld.go
go run: cannot run non-main package
执行go run helloworld.go时报异常:go run: cannot run non-main package
原因:go的main方法只有在main的包下面才能执行,因此新建一个名为main的包,将helloworld.go放入这个包下面,然后运行即可