如何开始学习Go语言?

huangapple go评论148阅读模式
英文:

How do I get started with Go?

问题

基本上,标题已经说得很清楚了:我该如何开始学习Go语言?当然,我知道Go官方网站和那里的文档,但还有其他资源吗?

有没有好的教程、视频、博客、书籍等等?

英文:

Basically, the title already says it all: How do I get started with Go? Of course I know the Go website and the documentation that is there, but what other resources are there?

Any good tutorials, videos, blogs, books, …?

答案1

得分: 6

从http://tour.golang.org开始。它会引导你了解语言的特性和区别。

然后在本地安装它,并尝试将你用其他语言编写的简单代码移植过来。

最重要的资源是标准包文档和像http://godoc.org/这样的网站,它为任何公共代码库提供在线文档生成器。

Effective Go这份文档对于解释如何使用各种语言特性非常有用。

Go wiki上有一系列的视频。

至于博客,可以尝试http://blog.golang.org/、http://dave.cheney.net/、http://labix.org/和http://www.goinggo.net/。

不幸的是,现有的Go图书都在不断变化,所以它们很难全面。我建议你坚持使用官方的包文档,它们通常包含丰富的代码示例。

一个关于惯用代码的好建议是阅读包的源代码文件,特别是*_test.go文件,因为它们通常提供了包的大多数使用方式的示例。顺便说一下,这是全面的包测试的一个很好的副作用。

英文:

Start with http://tour.golang.org. It will guide you through the language features and differences.

Then install it locally and try to port something simple you've written in another language.

The most important resources are the standard package docs and sites like http://godoc.org/ which provides an online documentation generator for any public code repositories.

The document Effective Go is also very useful for explanations of how to use the various language features.

There is a collection of videos on the Go wiki.

For blogs, try http://blog.golang.org/ , http://dave.cheney.net/ , http://labix.org/ and http://www.goinggo.net/ for starters.

Unfortunately, the Go books that are out there are aiming at a moving target so they struggle to be comprehensive. I'd recommend sticking with the official package docs which are usually replete with code examples.

A good tip for idiomatic code is to read the package source files, especially the *_test.go files as they usually provide nice examples of most of the ways the package can be used. This is, as an aside, a wonderful side-effect to comprehensive package tests.

huangapple
  • 本文由 发表于 2013年12月19日 17:53:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/20678327.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定