Learn Go facts and details by participating in some quizzes. NEW!

An Introduction of Go

Go is a compiled and static typed programming language born from Google. Many of the core Go design and SDK development team members have many years of experience in the field of programming language research.

Go has many features. Some are unique, some are borrowed from other programming languages: Besides the above features, further highlights are:

Go programmers are often called gophers.

In fact, although Go is a compiled and static typed programming language, Go also has many features which are usually only available in dynamic script languages. It is hard to combine these two kinds into one language, but Go did it. In other words, Go owns both the strictness of static languages and the flexibility of dynamic languages. I can't say there are not any compromises between the two, but the effect of the compromises is much weaker than the benefits of the combination in Go.

Readability is an important factor which affects the design of Go heavily. It is not hard for a gopher to understand the Go code written by other gophers.

Currently, the most popular Go compiler is written in Go and maintained by the Go design team. Later we shall call it the standard Go compiler, or gc (an abbreviation for Go compiler, not for garbage collection GC). The Go design team also maintains a second Go compiler, gccgo. Nowadays it's use is less popular than gc, but it always serves as a reference, and both compilers are in active development. As of now the Go team focuses on the improvement of gc.

gc is provided in the official Go SDK. Go SDK 1.0 was release in March, 2012. The version of Go is consistent with the version of Go SDK. There were/are two major versions released each year.

Since the release of Go 1.0, the syntax of Go has changed a little, but there were/are many improvements for the tools in Go SDK, from version to version, especially for gc. For example, noticeable lags caused by garbage collecting is a common criticism for languages with automatic memory management. But since Go 1.8, improvements made for the concurrent garbage collection implementation in gc basically eliminated the lag problem.

gc supports cross-platform compilation. For example, we can build a Windows executable on a Linux OS, and vice versa.

Programs written in go language mostly compile very fast. Compilation time is an important factor for the happiness in development. Short build time is one reason why many programmers like programming with Go.

Advantages of Go executables are: Some other compiled languages, such as C/C++/Rust may also have these three advantages (and they may have their respective advantages compared to Go), but they lack three important characteristics of Go:

All the above advantages combined make Go an outstanding language and a good choice for many kinds of projects. Currently, Go is popularly used in network, system tools, database development and block chain development areas. Lately more and more embrace Go for building games, big data and AI projects.

Finally, Go is not perfect in all aspects. There are certain trade-offs in Go design. And the current Go 1 really has some shortcomings. For example, Go doesn't support generics for custom types and functions now. Go team members are not against introducing custom generics into Go, they just haven't found a good solution yet which keeps Go clean and simple. Go 2 is in planning now. Nothing is impossible in the future.

The Go 101 project is hosted on both Github and Gitlab. Welcome to improve Go 101 articles by submitting corrections for all kinds of mistakes, such as typos, grammar errors, wording inaccuracies, description flaws, code bugs and broken links.

If you would like to learn some Go details and facts every serveral days, please follow Go 101's official Twitter account: @go100and1.

The digital versions of this book are available at the following stores and forms: Tapir, the author of Go 101, has spent 3+ years on writing the Go 101 book and maintaining the go101.org website. New contents will continue being added to the book and the website from time to time. If you would like to, you can support the book and the website by making a donation through Paypal ($5, $9, $15, or $25) or buying Tapir a coffee (way 1 and way 2).

You can also support Go 101 by playing Tapir's games.
Cryptocurrency donations are welcome too:
Bitcoin: 1xucQbv5jujFPPwhyg395ri5yV71hx9g9
Ethereum: 0x5dc4aa2c2bbfaadae373dadcfca11b3358912212