Programming · PRC-29

Golang for Beginners

Golang for Beginners is a foundation course in the Go language, covering data types, functions, slices, structs, interfaces and generics, error handling, concurrency with goroutines and channels, testing and a web service built with net/http. It suits developers with programming basics and anyone who wants to build services that handle many requests.

Updated
From 7,650 THB / person 8,500 −10% excl. VAT 7% · group rates available
PDFDownload the course outline
  • Duration18 hours · 3 days
  • FormatOnsite / live online
  • Next roundOn request
  • CertificateIncluded

Course overview

Go, or Golang, is a language developed at Google that has become popular for backend, cloud and DevOps tooling. It compiles to a single file that runs anywhere you copy it, performs well, uses little memory and handles large amounts of concurrent work through goroutines and channels. Yet people coming from other languages are often confused by ideas specific to Go, such as slices, implicit interfaces, errors returned as values and concurrent code that must avoid race conditions.

This new edition is updated for Go 1.27. It takes learners from installing the tools and Go modules through variables, data types, control structures and functions to slices, maps, strings, pointers and structs, then methods, interfaces and generics. Learners handle errors the Go way, write concurrent programs with goroutines, channels, sync and context, organise code into packages with tests, and finish by building a small web service with the standard library's net/http. (3 days, 6 hours per day, 18 hours in total, Beginner level.)

What you’ll gain

  • Install Go and use go run, go build, go mod and go test
  • Write programs with Go variables, data types, control structures and functions
  • Use arrays, slices, maps, strings and pointers correctly and understand how they work
  • Design programs with structs, methods, interfaces, composition and generics
  • Handle errors with wrapping, errors.Is and errors.As
  • Write concurrent programs with goroutines, channels, sync and context, and detect data races
  • Organise code into packages and write table-driven unit tests
  • Build a small web service with net/http that exchanges JSON

Who this course is for

  • Developers who already use another language and want to start with Go
  • People who want to build web or backend services that handle many requests
  • DevOps engineers and system administrators who need to read or write Go tools
  • Students with programming basics who are interested in Go

Prerequisites

  • Programming basics in any language, such as variables, conditions, loops and functions
  • No previous Go experience is needed
  • Basic command-line skills
  • A Windows, macOS or Linux laptop with permission to install software

Curriculum

Course Details

This course is the 2026 edition of Golang for Beginners, rewritten for Go 1.27. It runs for 3 days, 6 hours per day (18 hours in total, 09:00-16:00), as lectures alternating with labs and workshops throughout. Beginner level. It suits people with programming basics in any language who want to start Go the right way. Learners practise the language basics, data structures, structs, interfaces and generics, error handling, safe concurrent programming and testing, and build a web service with net/http. Afterwards they can move on to the RESTful API with Go and Gin or Go with Fiber Framework courses. They take home a lab guide and source code for every workshop.

Day 1 Getting Started with Go

Section 1: Lab: Meet Go and Install the Tools

  • What Go is, its strengths and limits, and where it is used, such as backends, cloud and DevOps tools
  • Install Go 1.27 on Windows, macOS or Linux, and VS Code with the Go extension
  • Create a project with go mod init and understand the go.mod file
  • The go run, go build, gofmt and go vet commands
  • Cross-compile for other operating systems with GOOS and GOARCH

Section 2: Lab: Variables, Data Types and Constants

  • Keywords, identifiers and naming rules that control exporting
  • Declare variables with var and := and understand zero values
  • Basic types, type conversion, and constants with iota
  • Operators, precedence and functions from the math package
  • Lab: calculate areas and print results with fmt format verbs

Section 3: Lab: Control Structures

  • if with a short statement before the condition
  • Every form of for, including range over an integer in recent Go
  • switch with and without an expression, and fallthrough
  • break, continue and labels
  • Lab: a grading program and a number-guessing game

Section 4: Lab: Functions in Go

  • Declare functions, parameters and multiple return values
  • Named return values and the blank identifier
  • Variadic functions, functions as values and anonymous functions
  • Closures and recursive functions
  • defer and the execution order you need to know

Section 5: Workshop: Your First Command-Line Program

  • Read input from command-line arguments and standard input
  • Split the work into readable, reusable functions
  • Format output clearly with fmt
  • Workshop: a command-line monthly expense calculator
Day 2 Data Structures, Structs and Interfaces

Section 6: Lab: Arrays and Slices

  • Fixed-size arrays, initialisation and multi-dimensional arrays
  • Slices and their backing arrays: length, capacity and growing with append
  • Create slices with make, re-slice and copy
  • Pitfalls when several slices share one array
  • Sort, search and compare data with the slices package

Section 7: Lab: Maps, Strings and Runes

  • Declare maps, add and delete entries and check whether a key exists
  • Maps as reference types, and helpers from the maps package
  • Immutable strings, bytes versus runes, and looping over Thai text correctly
  • The strings package and strings.Builder for building text
  • Lab: count words and characters in a text

Section 8: Lab: Pointers and Structs

  • What pointers are, why to use them, and declaring and dereferencing them
  • Create pointers with new and pass pointers to functions
  • Declare structs, initialise them and nest them
  • Copying and comparing structs
  • Composition by embedding structs instead of inheritance

Section 9: Lab: Methods and Interfaces

  • Methods with value and pointer receivers
  • Implicit interfaces with no implements keyword
  • Polymorphism with interfaces, and common ones such as Stringer
  • any, type assertions and type switches
  • Lab: a shipping-cost calculator for several carriers using interfaces

Section 10: Lab: Generics and Iterators

  • Type parameters and constraints such as comparable and cmp.Ordered
  • Write reusable generic functions and types
  • Methods with type parameters, available from Go 1.27
  • Iterators and ranging over functions
  • Lab: build a generic stack and filter function
Day 3 Errors, Concurrency and Web Services

Section 11: Lab: Handling Errors the Go Way

  • Errors as return values, created with errors.New and fmt.Errorf
  • Wrap errors with %w and inspect them with errors.Is and errors.As
  • Define your own error types and combine errors with errors.Join
  • When to use panic and recover, and when not to
  • Lab: read a data file and report errors clearly

Section 12: Lab: Goroutines and Channels

  • Concurrency versus parallelism, and goroutines versus threads
  • Start goroutines and wait for them with sync.WaitGroup and its Go method
  • Buffered and unbuffered channels, channel direction and closing channels
  • Wait on several channels with select and add timeouts
  • What causes deadlocks and how to prevent them

Section 13: Lab: sync, context and Worker Pools

  • Race conditions and detecting them with go run -race
  • Protect shared data with sync.Mutex and sync.RWMutex
  • Cancel work and set deadlines with context
  • Common worker pool and pipeline patterns
  • Lab: download several files concurrently with a limited number of workers

Section 14: Lab: Packages, Modules and Testing

  • Split code into packages and use a common project layout
  • Add dependencies with go get and tidy them with go mod tidy
  • Write unit tests and table-driven tests with go test
  • Measure coverage with -cover and write benchmarks
  • Lab: test the functions built during the course

Section 15: Workshop: A Web Service with net/http

  • How HTTP requests and responses work
  • Define routes with http.ServeMux using methods and path parameters
  • Exchange JSON with encoding/json and render pages with html/template
  • Workshop: a task list web service that stays safe under concurrent requests
  • Next steps towards REST APIs, databases and Docker

Schedule & training options

For individuals — public rounds

No public rounds are open right now. Join the waiting list and we will contact you first when the next round opens, or ask us on LINE. Or call 02-570-8449 or 088-807-9770

For organisations — in-house / private

  • Tailor the content to your team’s tools and projects
  • Your dates, at your office or live online
  • Quotation with tax ID for procurement
Corporate training quote

Instructors

Frequently asked questions

What is a goroutine and how does it differ from a thread?

A goroutine is a function that runs concurrently with the rest of the program, started simply by putting go in front of a function call. The Go runtime schedules many goroutines onto a small number of operating system threads. Each goroutine starts with a small stack that grows as needed, so you can create very many of them using far fewer resources than threads. In recent Go, sync.WaitGroup and its Go method make starting and waiting for goroutines simpler.

What are channels used for in Go?

Channels pass data safely between goroutines, following Go's idea of sharing memory by communicating. You create one with make(chan int), send with ch <- v and receive with v := <-ch. With an unbuffered channel the sender waits until there is a receiver, so channels also synchronise work. Use close when there is nothing more to send, select to wait on several channels, and context to cancel long-running work. If several goroutines change the same data directly, protect it with sync.Mutex and check with -race.

How do slices and arrays differ in Go?

An array has a fixed size that is part of its type, so [5]int and [10]int are different types, and passing an array to a function copies all of it. A slice is a view onto a backing array made of a pointer, a length and a capacity. It grows with append and can be created with make. Because several slices can share one array, changing values through one slice can affect another. In practice Go code uses slices far more than arrays, with the slices package for sorting and searching.

Who is the Golang for Beginners course for, and what should I know beforehand?

It suits developers who already use another language, people who want to build web or backend services that handle many requests, DevOps engineers and students interested in Go. You should have programming basics in any language, such as variables, conditions, loops and functions, and be comfortable with the command line. Go itself is taught from installation onwards.

What will I be able to do after the Golang for Beginners course?

You will be able to install Go and use Go modules, write programs with variables, data types, control structures and functions, use slices, maps, strings and pointers, build structs, interfaces and generics, handle errors with errors.Is and errors.As, write concurrent programs with goroutines, channels, sync and context while checking for data races, write tests with go test and build a small web service with net/http. Participants who complete the training receive a Certificate of Completion with its own number, which can be verified online.

Can the Golang for Beginners course be run in-house for our team?

Yes. This course can be run in-house for your team, with examples adapted to your work, such as practising concurrent programming on problems close to the systems your team maintains. You can request a quotation from this page or contact us on LINE @itgenius or by phone on 02-570-8449.