Hands-On Introduction: Go

Hands-On Introduction: Go

2h 39mIntermediate2022-11-09

Authors

Johnny Boursiquot

Johnny Boursiquot

Cloud Engineer, Community Organizer, Speaker, Trainer

Course details

If you’re looking for a practical, idiomatic way to learn the basics of the Go programming language, this course has your name written all over it—plus, it’s so simple and easy to use. Instructor Johnny Boursiquot shows you the building blocks of working directly with the Go command line and exploring the core features of its syntax to extend your workflow. Get an in-depth introduction to the key concepts you need to know to start writing professional-grade code in Go on your own, with tips on how to work with packages, primitive and composite types, flow control, interfaces, and goroutines. Along the way, learn how to tap into the Go toolchain to compile and test your code as you go, leveraging the power of concurrency synchronization using channels to communicate data between multiple goroutines at the same time.

Skills covered

GoGoogleProgramming LanguagesSoftware DevelopmentOne-Off

Concepts

Introduction

  • Hands-on with Go
  • Using GitHub Codespaces with this course

Packages and Functions

  • Code organization with packages
  • Importing and using packages
  • Third-party packages
  • Packages and visibility
  • Functions
  • Challenge 1 - Working with packages

Basic Types and Variables

  • Variables, types, and scope
  • Constants
  • Type conversions
  • Pointers
  • Challenge 2 - Working with primitive types

Composite Types

  • Struct basics
  • Struct methods
  • Struct pointers
  • Struct embedding
  • Arrays
  • Slices
  • Maps
  • Challenge 3 - Working with composite types

Flow Control

  • Loops
  • Conditionals
  • Defer, panic, and recover
  • Challenge 4 - Flow control

Interfaces

  • Defining and implementing interfaces
  • The empty interface
  • Type assertions
  • Type switches
  • Challenge 5 - Working with interfaces

Generics

  • Type parameters
  • Interface constraints
  • Standard library support
  • Challenge 6 - Refactoring with generics

Testing

  • Writing simple tests, setup, and teardown
  • Table-driven tests
  • Benchmarking
  • Challenge 7 - Write some tests

Concurrency

  • Goroutines
  • Channel basics
  • Buffered channels
  • Channel ranging
  • Channel select
  • Channel non-blocking
  • Sync package
  • Challenge 8 - Goroutine synchronization

Conclusion

  • Next steps
80,000 Toman