Course Overview

If you are leveraging Go to create applications on the job or on your own, attending this course will help you understand how Go works, and immediately be more productive.

If you are building a team using Go, this will be a great opportunity to get your team on the same page and speaking the same language.

The materials and presentation focus on teaching students how to write clear and robust code to create real-world solutions.  Innovative lab exercises and code samples are provided to reinforce skills and quickly master the topics.

Includes time for instructor presentation, instructor-led demos, hands-on lab time, and Q&A.

If customization is required, the class duration may change.

Key Learning Areas

  • Learn the basic structural elements of a Go program
  • Learn to use the basic types, aggregate types, reference types, and interfaces
  • Learn error-handling strategies
  • Learn to compose types and implement encapsulation
  • Learn how to create a method (receiver function) on a struct
  • Learn how and when to use pointers
  • Learn how to use the interface type to enforce a contract
  • Learn how and when to use anonymous functions
  • Learn how to send and receive data using channels
  • Learn multithreading and synchronization techniques
  • And more…

Course Outline

Introduction to Go

  • Learn the features and origins of Go
  • Install and configure Go on your OS
  • Choose an IDE
  • Review Go

Packages

  • Learn the basic components of the Go language
  • Examine several common programming tasks
  • Utilize the built-in library
  • Examine keywords and names
  • Learn to declare variables and constants
  • Review variable lifetime and scope
  • Define and use pointers

Working with Basic Data Types

  • Examine and work with numbers, strings, and booleans
  • Understand the importance of UTF-8 in Go
  • Use standard packages to manipulate strings
  • Use the constant generator

Arrays, Slices, and Maps

  • Use and understand the relationship of arrays and slices
  • Extend slices using the built-In append function
  • Learn slicing techniques
  • Create hash tables using the map data type

Structs

  • Create user defined data types using struct
  • Use struct literal syntax
  • Learn the rules of comparing structs
  • Learn the mechanism of struct embedding
  • Learn how and when to use anonymous fields

Functions

  • Declare and call a function
  • Return multiple values from a function
  • Define a variadic function
  • Create a recursive function
  • Define and use function objects
  • Define and use anonymous functions
  • When and how to use deferred functions

Error Handling

  • Error-handling strategies
  • Dealing with errors: panic and recover

Methods

  • Review object-oriented programming
  • Understand the purpose and need for methods
  • Learn to declare a method
  • Use methods with a pointer receiver

Interface

  • Review object-oriented methodologies
  • Create and use interfaces to enforce a contract
  • Understand interface satisfaction
  • Interface type assertions and switches

Goroutines and Multithreading

  • The need for concurrency
  • Overview of Goroutines and Channels
  • Use buffered and unbuffered channels
  • Implement shared memory multithreading
  • Handle race conditions

I/O and Networking

  • Work with files
  • Review networking concepts
  • Build a simple http server

Who Benefits

Students attending a class should have at least 6 months experience programming in a language such as Java, C / C++, C#. Experience programming in a scripting language such as JavaScript or Python is also sufficient.

Prerequisites

No prior experience with Go is assumed or required.

Attendees will be provided with course materials which include the coursebook in pdf format, dozens of examples of Go, and lab solutions. Example programs are intentionally small and easy to understand, so as to focus on the language without getting sidetracked by complicated algorithms or data structures.