O'Reilly logo
live online training icon Live Online training

Getting Started with Go

Learn core skills from syntax to synchronizing

Cory LaNou

Go is a modern programming language with a heavy focus on developer productivity, scalability, and speed. Whether you're a recent grad or an industry veteran, there's no better time to learn the core concepts of the Go programming language. In this two-day hands-on course, Go expert Mark Bates introduces language fundamentals, such as primitives, language structure, design, and concurrency. If you have little or no experience with Go and want to jumpstart your knowledge, this course is for you.

What you'll learn-and how you can apply it

By the end of this live online course, you’ll understand:

  • The basic keywords and syntax of the Go language
  • How to work with executable and library packages
  • How to use slices, maps, and pointers
  • How Go handles concurrency

And you’ll be able to:

  • Create, initialize, and index an array
  • Declare and call functions
  • Handle basic errors
  • Synchronize communication and work with Goroutines

This training course is for you because...

  • You want to review the Go language to see if it's something that will work for you and your team’s next project.
  • You currently develop in another language and are interested in learning how Go handles similar constructs and how it's different.

Prerequisites

  • A working knowledge of a modern programming language (Java, Ruby, Python, C, C++, C#, Perl, etc.)
  • A basic understanding of operating system concepts and environment variables
  • Experience working with a command shell and navigating a filesystem

Materials or downloads needed in advance:

Recommended preparation:

Go Programming Basics (Learning Path)

Recommended follow-up:

Go Core Tools and Techniques (Learning Path)

About your instructor

  • Cory LaNou a full stack technologist who has specialized in start-ups for the last 20 years. Cory worked on the Core engineering team that contributes to InfluxDB, a highly scalable, distributed time series database written in Go. Cory has worked on several Go projects with a focus on profiling and optimizing applications, using advanced profiling concepts such as flame graphs and tracing profiles. Cory has created and led numerous Go workshops and training courses. He has several published online articles related to Go. Cory also helps lead and organizer several community technology meetups and mentors new developers.

Schedule

The timeframes are only estimates and may vary according to how the class is progressing

Day 1

Introduction and setup (50 minutes)

  • Lecture and hands-on exercises: Introducing Go; installing Go; setting up your GOPATH and GOBIN; options for code editors; syntax and types

Break (10 minutes)

Working with Go's value types (50 minutes)

  • Lecture and hands-on exercises: Handling strings and UTF-8 text; variables, constants, and iota; creating structs and initializing them; executable and library packages; creating your own package and using it within another package

Break (10 minutes)

Arrays, slices, maps, and more (60 minutes)

  • Lecture and hands-on exercises: Creating, initializing, and indexing an array; basic loop constructs and control; creating and initializing slices; growing slices and working with subsets of slices; basic map creation, initialization, and iteration

Day 2

Pointers (50 minutes)

  • Lecture and hands-on exercises: Understanding pointers; the difference between pass by value and pass by reference; declaring pointers and referencing values as pointers; maximizing performance and security and when to use pointers; declaring and calling functions; sending and receiving zero or many arguments

Break (10 minutes)

Interfaces (50 minutes)

  • Lecture and hands-on exercises: Using interfaces to abstract behavior of an object; understanding "Empty Interface"; satisfying multiple interfaces and asserting for behavior; understanding the difference between value and pointer receivers and how they affect the ability to satisfy an interface

Break (10 minutes)

Error models (30 minutes)

  • Lecture and hands-on exercises: Working with Go's error model for more reliable code; handling basic errors and returning errors as an interface that satisfies the error type; understanding custom error types and panics; recovering from panics and sentinel errors

Concurrency and Goroutines (20 minutes)

  • Lecture and hands-on exercises: Concurrency and Goroutine fundamentals; how to synchronize communication; working with buffered and unbuffered channels

Wrap-up and Q&A (10 minutes)