Free course · 46 topics · about 60 hours
Go Programming (backend and cloud)
Ask or find help in Go Programming (backend and cloud)
Type a question or a word. You get the topics, explanations, meanings and quiz answers that cover it, and each result opens at the right place.
Try:
Your timeline: start to finish
About 9 weeks at 1 hour a day (60 study days) · 0/10 modules done
BeginnerWeeks 1–3
- Getting started with GoWeek 1
5 topics · 2.5 h of lessons · ~5.3 h with practice · you are here
- Control flow and functionsWeeks 1–2
5 topics · 2.8 h of lessons · ~5.8 h with practice
- Collections and structsWeeks 2–3
5 topics · 3.1 h of lessons · ~6.6 h with practice
IntermediateWeeks 3–6
- Pointers, interfaces and errorsWeeks 3–4
5 topics · 2.8 h of lessons · ~6.1 h with practice
📝 Module 4 exam: Pointers, interfaces and errors · 14 questions
- Packages, testing and genericsWeeks 4–5
5 topics · 2.9 h of lessons · ~6.2 h with practice
📝 Module 5 exam: Packages, testing and generics · 14 questions
5 topics · 2.9 h of lessons · ~6.2 h with practice
ExpertWeeks 6–9
4 topics · 2.7 h of lessons · ~5.7 h with practice
- Building a REST API with a databaseWeeks 6–7
4 topics · 2.8 h of lessons · ~5.9 h with practice
📝 Module 8 exam: Building a REST API with a database · 14 questions
- CLI tools and Go in cloud and DevOpsWeeks 7–8
4 topics · 2.3 h of lessons · ~4.8 h with practice
📝 Module 9 exam: CLI tools and Go in cloud and DevOps · 12 questions
- Careers and interviewsWeeks 8–9
4 topics · 3 h of lessons · ~6.3 h with practice
Final exam: Go Programming (backend and cloud)Week 9
40 questions · 60 min · pass 70% for the certificate
Weeks count lessons, practice, quizzes and exams (about 60 hours in all), studying every day. Go faster or slower as you like: your place is kept on this device.
0/46 topics done
Beginner
Install Go, learn the syntax, control flow and functions, then slices, maps, strings and structs. After this level you can write and run small Go programs that store and process real data.
1Getting started with Go0/5 topics▼
What Go is and why cloud companies use it, installing the toolchain, your first module and program, and variables, types, constants and conversions. After this you can create a Go module, write and run a small program, and explain every line of it.
- What Go is and why people use itGo (also called Golang) is a programming language made at Google and released as open source in 2009. It is compiled into one fast program file, it cleans up memory for you, and it has very few features on purpose, so code stays easy to read. Docker, Kubernetes, Terraform and Prometheus are written in Go.25 min
- Installing Go and the go commandYou install Go once from go.dev. After that, one command called go does almost everything: go run runs a program, go build makes a binary, go fmt formats code, go vet finds suspicious code, go test runs tests and go env shows settings.30 min
- Your first program and Go modulesA Go project is a module: a folder with a go.mod file that names the project and the Go version it needs. Every runnable program has package main and a func main, where it starts. You create a module with go mod init and run it with go run .30 min
- Variables, basic types and zero valuesA variable is a named box that holds a value of one fixed type, such as int, float64, string or bool. You declare it with var, or with := inside functions. A variable you do not set gets its zero value (0, "", false), and a local variable you never use is a compile error.35 min
- Constants, iota and type conversionsA constant is a value fixed when the program is compiled, declared with const. iota counts 0, 1, 2 inside a const block, which is handy for lists of options. Go never converts types for you: to mix an int and a float64 you write float64(n) yourself, and text-to-number needs the strconv package.30 min
2Control flow and functions0/5 topics▼
Decisions with if and switch, every kind of loop with for, functions with several return values, closures, and defer. After this you can write programs that make decisions, repeat work and are split into small, reusable functions.
- Decisions with if and switchif runs a block only when a condition is true; Go needs no brackets around the condition but always needs braces. An if can start with a short statement, like reading a value, before the condition. switch picks one case out of many and, unlike C or Java, does not fall through to the next case.30 min
- Loops: for is the only loopGo has exactly one loop keyword, for, used in three shapes: the classic counter loop, a while-style loop with just a condition, and an endless loop. for ... range walks over slices, strings, maps, channels and (since Go 1.22) plain integers. break leaves a loop and continue skips to the next round.35 min
- Functions and multiple return valuesA function is a named block of code that takes inputs (parameters) and gives back results. Go functions can return several values, which is how they report errors: a result plus an error. Arguments are copied into the function, Go has no default parameter values, and named results can document what is returned.35 min
- Variadic functions, function values and closuresA variadic function accepts any number of arguments, like fmt.Println; inside, they arrive as a slice. Functions are values: you can store them in variables and pass them to other functions. A closure is a function that remembers variables from the place where it was created.35 min
- defer: clean up at the enddefer schedules a function call to run when the surrounding function returns, whether it returns normally or because of a panic. Deferred calls run in reverse order (last in, first out), and their arguments are worked out immediately, when the defer line runs. It is the Go way to close files, unlock locks and finish clean-up.30 min
3Collections and structs0/5 topics▼
Arrays and slices (and how slices really work underneath), strings and runes, maps, and structs with methods. After this you can store and process lists, look-up tables and your own record types, and avoid the slice and map bugs that catch most beginners.
- Arrays and slicesAn array has a fixed length that is part of its type, like [5]int, and is copied when you assign it. A slice, like []int, is a flexible view of an array that can grow with append. In real Go code you use slices almost all the time.35 min
- Slices in depth: length, capacity and sharingA slice is a small header with three parts: a pointer to an array, a length and a capacity. Slices made from the same array share data, so changing one can change another, and append may or may not create a new array. Knowing this explains most slice bugs. Since Go 1.21 the slices package gives ready-made Sort, Contains, Index and more.40 min
- Strings, bytes and runesA Go string is a read-only sequence of bytes, usually holding UTF-8 text. len(s) counts bytes, not characters, so "₹500" has length 6. A rune is one Unicode character; range over a string gives runes. The strings package has the everyday tools: Split, Join, Contains, TrimSpace, ToUpper and strings.Builder.35 min
- Maps: key-value look-upsA map stores values by key, like a phone book stores numbers by name. You read with m[key], add with m[key] = value and remove with delete. A missing key gives the zero value, so use the "comma ok" form to know if it was really there. Iteration order is random, writing to a nil map panics, and maps are not safe for writes from several goroutines at once.35 min
- Structs and methodsA struct groups related fields into one type, like a Student with Name, Roll and Marks. A method is a function attached to a type. A value receiver works on a copy; a pointer receiver can change the original. Go has no classes or inheritance; it uses embedding to reuse fields and methods.40 min
Intermediate
Pointers, interfaces and errors; packages, modules, testing and generics; then goroutines, channels, sync and context. After this level you can structure and test a Go project and write safe concurrent code.
1Pointers, interfaces and errors0/5 topics▼
Pointers and when to use them, interfaces and the any type, type assertions and switches, Go's error handling with wrapping, errors.Is and errors.As, and when panic and recover are right. After this you can design small, testable types with interfaces and handle errors the way professional Go code does.
- Pointers without fearA pointer holds the memory address of a value instead of the value itself. &x gives the address of x, and *p reads or changes the value a pointer points to. Go pointers are safe: there is no pointer arithmetic and the garbage collector frees memory for you. Use pointers to let a function change something, to avoid copying big structs, or to show that a value may be absent (nil).35 min
- Interfaces: behaviour, not family treesAn interface is a type that lists methods. Any type that has those methods satisfies the interface automatically; you never write "implements". Small interfaces like io.Reader, io.Writer, fmt.Stringer and error are the heart of Go. Write functions that accept interfaces, so they work with many types and are easy to test.40 min
- any, type assertions and type switchesany (another name for interface{}) can hold a value of any type. To get the concrete value back, use a type assertion v, ok := x.(string), or a type switch to handle several types. An interface value is nil only when both its type and value are empty, which causes the famous "nil error that is not nil" bug.30 min
- Errors as values: wrap, Is and AsIn Go an error is a normal value returned from a function, not an exception. You check it with if err != nil right away. Add context with fmt.Errorf and %w (wrapping), then check for a specific error anywhere up the chain with errors.Is, or pull out a custom error type with errors.As.40 min
- panic and recover: only for the truly unexpectedA panic stops the normal flow of a goroutine, runs its deferred calls, and, if nothing recovers, crashes the program with a stack trace. recover, called inside a deferred function, can stop a panic. Use errors for expected problems (bad input, missing file) and panic only for bugs and impossible situations.25 min
2Packages, testing and generics0/5 topics▼
Organise code into packages, manage dependencies with Go modules, write table-driven tests, benchmarks and fuzz tests, and use generics where they truly help. After this you can structure a real Go project, add libraries safely, and prove your code works with go test.
- Packages, visibility and project layoutA package is one folder of .go files that share a package name. Names that start with a capital letter are exported (usable from other packages); lowercase names are private. A folder called internal can only be imported by code next to or above it. Start with a simple layout and add folders only when the project needs them.35 min
- Dependencies with Go modulesgo get adds or updates a dependency and records it in go.mod; go.sum stores checksums so downloads cannot be tampered with. go mod tidy adds what is missing and removes what is unused. Versions follow semantic versioning, and from v2 onwards the major version is part of the import path, like github.com/jackc/pgx/v5.30 min
- Testing with go testGo has testing built in. Put tests in files ending in _test.go, write functions named TestXxx(t *testing.T), and run go test ./... Go developers write table-driven tests: a list of inputs and expected outputs checked in one loop, with t.Run giving each case a name. -cover shows how much code the tests run, and -race finds data races.40 min
- Benchmarks and fuzz testsA benchmark, BenchmarkXxx(b *testing.B), measures how fast code runs; go test -bench=. runs them and -benchmem adds memory use. Measure before you optimise. A fuzz test, FuzzXxx(f *testing.F), feeds your function many generated inputs to find crashes and broken rules you did not think of.30 min
- Generics: type parameters and constraintsGenerics (Go 1.18+) let you write one function or type that works for many types, like Max for ints, floats and strings. Type parameters go in square brackets with a constraint saying what the type must support: any, comparable, cmp.Ordered or your own interface. Use generics for containers and algorithms, not for everything.40 min
3Concurrency: goroutines, channels and context0/5 topics▼
Go's famous concurrency: goroutines, channels, select, the sync package and the race detector, and context for timeouts and cancellation. After this you can run work in parallel safely, build a worker pool, stop slow work with timeouts, and explain these ideas in an interview.
- Goroutines and WaitGroupA goroutine is a function running at the same time as the rest of your program, started with the go keyword. Goroutines are very cheap, so a program can run thousands of them. When main returns, the program ends and all goroutines stop, so you wait for them with a sync.WaitGroup (or channels).35 min
- Channels: passing data between goroutinesA channel is a typed pipe that one goroutine sends values into and another receives from. On an unbuffered channel, the sender waits until a receiver takes the value; a buffered channel holds a few values first. The sender closes a channel to say "no more values", and range on a channel reads until it is closed. If every goroutine is stuck waiting, Go stops with "all goroutines are asleep - deadlock!".40 min
- select: waiting on several channelsselect waits on several channel operations and runs whichever is ready first; if several are ready it picks one at random. A case with time.After gives you a timeout, and a default case makes the select non-blocking. A for-select loop is the heart of many Go workers and servers.30 min
- Mutex, Once, atomic and the race detectorA data race happens when two goroutines touch the same variable at the same time and at least one writes. The result is unpredictable. sync.Mutex lets only one goroutine at a time into a critical section; RWMutex allows many readers; sync.Once runs set-up exactly once; sync/atomic gives fast safe counters. go test -race finds races for you.35 min
- context: timeouts and cancellationA context.Context carries a deadline and a cancel signal across function calls and goroutines. Create one with context.WithTimeout or WithCancel, always defer cancel(), pass ctx as the first parameter, and stop work when ctx.Done() is closed. HTTP servers, HTTP clients and database/sql all accept a context.35 min
Expert
The standard library for web services, a REST API with a database, CLIs, Docker and Go in the cloud, and interview preparation. After this level you can build, containerise and explain a production-style Go service and apply for Go backend roles.
1Standard library essentials0/4 topics▼
The parts of the standard library every Go backend developer uses daily: the net/http server with Go 1.22 routing, the HTTP client done safely, encoding/json, and files, time and structured logging with log/slog. After this you can build a small JSON web service and call other APIs using only the standard library.
- An HTTP server with net/httpnet/http gives you a production-grade web server with no extra libraries. A handler is a function that receives a request and writes a response. Since Go 1.22, http.ServeMux understands methods and path wildcards, like "GET /items/{id}", and r.PathValue("id") reads the value. In production, start the server through an http.Server with timeouts.45 min
- Calling other APIs safely with the HTTP clientUse one shared http.Client with a Timeout; the default client used by http.Get never times out. Always close resp.Body, check resp.StatusCode yourself (a 404 or 500 is not an error in Go), and limit how much of the body you read. Add a context to cancel calls when the caller gives up.35 min
- JSON with encoding/jsonjson.Marshal turns Go values into JSON and json.Unmarshal (or a json.Decoder) turns JSON into Go values. Only exported (capitalised) struct fields are included. Struct tags like `json:"name,omitempty"` set the JSON key and can skip empty values. Unknown JSON keys are ignored unless you ask the decoder to reject them.40 min
- Files, time and structured logsos.ReadFile and os.WriteFile handle small files in one call; bufio.Scanner reads big files line by line. The time package measures durations and formats dates with a reference layout, "2006-01-02 15:04:05". log/slog (Go 1.21+) writes structured logs as key-value pairs or JSON, which production log tools can search.40 min
2Building a REST API with a database0/4 topics▼
Design and build a JSON REST API in Go: handlers, status codes and validation, middleware for logging and panic recovery, PostgreSQL or MySQL through database/sql without SQL injection, configuration from environment variables, and graceful shutdown. After this you can build, test and run a small production-style API service on your own.
- REST API design and JSON handlersA REST API exposes resources (expenses, orders) at URLs and uses HTTP methods to act on them: GET reads, POST creates, PUT or PATCH updates, DELETE removes. Good handlers decode and validate input, call the business logic, and reply with the right status code and a JSON body, including clear JSON errors.45 min
- Middleware: logging, recovery and request IDsMiddleware is a function that wraps a handler to add behaviour before and after it: logging every request, recovering from panics, adding a request ID, checking auth. In Go its shape is func(next http.Handler) http.Handler. You chain middleware by wrapping one around another; the outermost runs first.35 min
- Databases with database/sqldatabase/sql is Go's standard way to talk to SQL databases; a driver package adds PostgreSQL, MySQL or SQLite. sql.Open does not connect immediately (call PingContext), and the *sql.DB it returns is a connection pool you share. Use QueryContext, QueryRowContext and ExecContext with placeholders ($1 for Postgres, ? for MySQL and SQLite) so values are never pasted into SQL, and always close rows.45 min
- Configuration, project structure and graceful shutdownRead configuration (port, database URL, log level) from environment variables, check it at start-up and fail fast if something required is missing. Organise the service as main plus a few internal packages. Shut down gracefully: catch SIGTERM with signal.NotifyContext, stop accepting new requests with server.Shutdown, let running ones finish, then close the database.40 min
3CLI tools and Go in cloud and DevOps0/4 topics▼
Build command-line tools with flags and proper exit codes, cross-compile one codebase for Linux, Windows and macOS, package a Go service in a tiny Docker image, and see how Go powers Kubernetes, Terraform and Prometheus. After this you can ship a Go program as a binary or container and understand why platform and DevOps teams choose Go.
- Command-line tools with flag and osA command-line tool (CLI) reads arguments and flags, does one job, prints results to standard output, errors to standard error, and exits with code 0 for success or non-zero for failure. Go's flag package parses flags like -n 5 or --verbose, os.Args holds the raw arguments, and big CLIs such as kubectl use the cobra library for subcommands.35 min
- Cross-compiling and build flagsGo can build a binary for another operating system and processor from your own machine: set GOOS (linux, windows, darwin) and GOARCH (amd64, arm64) before go build. CGO_ENABLED=0 gives a fully static binary that runs in minimal containers. -ldflags can shrink the binary and stamp a version into it.30 min
- Docker images for Go servicesA multi-stage Dockerfile builds your Go binary in the official golang image, then copies only the binary into a tiny final image such as distroless static or scratch. The result is small, starts fast, and has very little attack surface. Run it as a non-root user and pass configuration through environment variables.35 min
- Go in cloud and DevOps: Kubernetes, Terraform and PrometheusMost cloud-native infrastructure is written in Go: Docker's engine and containerd, Kubernetes, etcd, Terraform, Prometheus, Helm and many more. Platform and DevOps engineers use Go to write CLIs, Kubernetes controllers (with client-go), Terraform providers and Prometheus exporters. Your Go services fit in with health checks, metrics and Kubernetes manifests.35 min
4Careers and interviews0/4 topics▼
Prepare for Go jobs: the language and concurrency questions interviewers ask most, a portfolio project that proves your skills, honest career paths and pay in India, and a 30-day revision plan. After this you can explain Go's core ideas clearly in an interview, show a finished project, and plan your job search.
- Go language interview questionsGo interviews check whether you really understand a small set of ideas: slices and their backing arrays, maps, value versus pointer receivers, interfaces and the nil-interface trap, defer order, error wrapping, make versus new, and the garbage collector. Practise explaining each in two or three plain sentences with a tiny code example.45 min
- Concurrency interview questions and coding roundsAlmost every Go interview asks about concurrency: goroutines versus threads, buffered versus unbuffered channels, deadlocks, races, mutex versus channel, and context. Coding rounds often ask you to fetch many URLs with limited parallelism, build a worker pool, or write a rate limiter. Practise these patterns until you can write them without notes.45 min
- Your portfolio project: a production-style Go APIOne finished, well-tested project beats ten half-done tutorials. Build a URL shortener or an expense API in Go with PostgreSQL, tests, a Dockerfile, CI that runs go vet and go test -race, graceful shutdown, structured logs and a clear README. Interviewers will open your repository and ask you to explain your choices.50 min
- Go careers in India and a 30-day revision planGo skills lead to roles such as backend developer, cloud or platform engineer, DevOps or SRE, and microservices developer. Go openings for freshers are fewer than for Java or Python, but Go is strong in product startups, fintech and cloud companies. Pair Go with SQL, Docker, Kubernetes and one cloud, build one solid project, and revise with a 30-day plan.40 min
🎓 Final exam and certificate
40 questions, 60 minutes, pass mark 70%. Pass it to get a certificate with your name.