1 Getting started with Go

 

This chapter covers

  • Introducing Go
  • Understanding where Go fits into the language landscape
  • Getting up and running in Go

This chapter introduces the Go language and its features at a high level, providing the foundation for professional developers to use the language to address real-world problems on the job. In this chapter, you’ll learn about Go and the toolchain that accompanies it, where Go fits into the landscape of languages, and how to install the language and get going quickly with your own application or module.

If you’ve been using Go for a while, some of this material will be a review, and you may find it beneficial to jump ahead. But in recent years, Go has changed quite a bit more than it did in its early days. The language remains tight and focused, but community feedback has led to some powerful new features, including support for generics.

1.1 What is Go?

Go, sometimes referred to as golang, is a statically typed and compiled open source programming language initially developed by Google. In 2007, Robert Griesemer, Rob Pike, and Ken Thompson attempted to create a language for modern systems programming that solved real-world problems they encountered while building large systems at scale. The language was publicly announced in November 2009 and quickly gained traction.

1.2 Noteworthy aspects of Go

1.2.1 Multiple return values

1.2.2 A modern standard library

1.2.3 Concurrency with goroutines and channels

1.2.4 Go the toolchain: More than a language

1.3 Go in the vast language landscape

1.3.1 C and Go

1.3.2 Rust, Zig, Nim, and Go

1.3.3 Java and Go

1.3.4 Python, PHP, JavaScript, and Go

1.4 Getting up and running in Go

1.4.1 Installing Go

1.4.2 Working with Git and version control

1.4.3 Exploring the workspace

1.4.4 Working with environment variables

1.4.5 Using artificial intelligence tools with Go

1.5 Hello, Go

Summary