O'Reilly logo
live online training icon Live Online training

Introduction to the Go Programming Language

No-nonsense Software Development

Jay McGavren

Are you tired of working on software projects that have gotten too complex? Tired of sitting around waiting for your code to compile? Tired of trying to shoehorn the functionality you need into a class inheritance structure?

Go represents a return to the basics of software development. Programs compile in seconds, not minutes. If a developer on your team makes a mistake, like failing to use a variable or handle an error, Go will point it out immediately, before they share the code with others. And features of other languages that tend to lead to bugs and bad design, such as class inheritance or threads, have been replaced with less error-prone concepts. Switch your project to Go, and reap the productivity benefits!

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

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

  • Go's strengths as a programming language
  • Types of projects Go is most suited for
  • What steps to take to continue learning Go

And you’ll be able to:

  • Write, build, and distribute simple command-line programs in Go
  • Organize code into reusable packages
  • Read Go package/function documentation

This training course is for you because...

  • You are a developer with existing programming experience, and you need a quick overview of Go's unique features.
  • You are a lead developer, and need to evaluate Go as a potential language for your next project.

Prerequisites

  • Experience using another programing language (e.g., Ruby, Java, Python)
  • Experience compiling and running code in another language

Materials or downloads required in advance:

About your instructor

Schedule

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

Go syntax (30 minutes)

  • Presentation: Go file layout: package, imports, code
  • Presentation: Compiling/running code
  • Presentation: Functions
  • Presentation: Packages
  • Presentation: Variables and Types
  • Exercise: Go syntax
  • Q&A

Declaring Functions (30 minutes)

  • Presentation: Declaring Functions
  • Presentation: Variable scope
  • Presentation: Multiple return values
  • Exercise: Declaring functions
  • Presentation: Pass-by-value
  • Presentation: Pointers
  • Exercise: Passing pointers
  • Q&A
  • Break (5 minutes)

Declaring Packages (20 minutes)

  • Presentation: The Go workspace
  • Presentation: Import paths
  • Presentation: go get
  • Presentation: go doc
  • Exercise: Using package documentation
  • Q&A

Structs (25 minutes)

  • Presentation: As underlying type for defined types
  • Presentation: Embedding structs
  • Exercise: Struct types
  • Q&A
  • Break (5 minutes)

Defined Types (20 minutes)

  • Presentation: With underlying basic types
  • Presentation: Defining methods
  • Presentation: Promotion of embedded types' methods
  • Exercise: Defined Types
  • Q&A

Interfaces (20 minutes) Presentation: Concrete types vs. interface types Presentation: Type assertions Exercise: Interfaces Q&A

Handling Errors (20 minutes)

  • Presentation: defer
  • Presentation: panic
  • Presentation: recover
  • Exercise: Handling Errors
  • Q&A
  • Break (5 minutes)

Concurrency (30 minutes)

  • Presentation: Goroutines
  • Presentation: Channels
  • Exercise: Goroutines and Channels
  • Q&A

Where to Go Next (10 minutes)

  • Presentation: Data structures: arrays, slices, maps
  • Presentation: "testing" package
  • Presentation: Web development
  • Presentation: Buffered channels
  • Presentation: Other resources
  • Q&A