Interactive roadmap
Go roadmap
Designed for absolute beginners who want to build fast, reliable backend software using the friendly Go programming language.
- 1
Basic Go Syntax
0 of 4 done
Get started with your very first Go program and basic variables.
Take your time setting up your editor and run your code often to build confidence early on. - 2
Slices and Maps
0 of 3 done
Manage collections of data efficiently using slices and maps.
Practise using range loops early, as you will use them constantly when building real backend APIs. - 3
Structs and Interfaces
0 of 3 done
Organise your code with custom data types and behaviors.
Design your structs around real-world nouns from your project to keep your code intuitive. - 4
Errors and Testing
0 of 3 done
Handle mistakes gracefully and write tests to check your work.
Never ignore errors in Go; handling them explicitly creates reliable software that rarely crashes. - 5
Concurrency and Web
0 of 3 done
Build fast concurrent applications and simple web services.
Start simple with one or two background tasks before building complex concurrent pipelines.
Learn it all, with a tutor that never sleeps
Every topic links to LevelUp lessons, practice exercises and the 24/7 AI Tutor. Your progress updates as you master lessons.
Every topic explained
Step 1: Basic Go Syntax
- Run your first simple Go program and see how output works on your screen.Go Documentation (Go Authors)
Read more
Writing your first program is the classic way to start any coding journey. In Go, you create a main package and print text to your screen using simple built-in commands.
Think of it like leaving a sticky note on your computer monitor that says hello to the world. It proves your tools are installed correctly and ready for action.
This matters because every large backend application starts with this exact same simple structure, so getting comfortable with it now sets a solid foundation.
- Every standalone program needs a main package
- The main function is where execution begins
- Use fmt dot Println to show text
- Store numbers, text, and true-false values using Go variable declarations.
Read more
Variables act like labelled storage boxes in your computer memory. You use them to hold numbers, words, or simple yes-no choices while your program runs.
For example, an online shop might use a variable to keep track of how many items are currently sitting in your shopping basket.
This matters because backend software is all about receiving, processing, and saving data, and variables are the primary tool for holding that data.
- Use var or the shorthand colon equals operator
- Go requires every variable to have a clear type
- Types prevent mixing up text and numbers accidentally
- Group reusable blocks of code into neat functions that take inputs and return results.
Read more
Functions are reusable recipes of code that take in some ingredients, perform a task, and dish out a result. Instead of repeating yourself, you write the logic once.
Imagine a recipe for baking bread that always takes flour and water and outputs a loaf, no matter who asks for it.
This matters because clean backend software is built from small, well-organised functions that are easy to test, read, and fix when things go wrong.
- Functions start with the func keyword
- Define input types inside the parentheses
- Specify return types before the curly braces
- (optional)
- Control how your code runs using if statements and for loops.
Read more
Control flow lets your code make decisions and repeat tasks. Conditions let you choose different paths, while loops let you repeat actions without copy-pasting code.
Think of a traffic light checking if the light is red to decide whether cars should stop, or a factory machine counting items until a box is full.
This matters because real backend applications constantly make choices based on user input and process lists of data in loops.
- Use if and else for conditional decisions
- Go only uses the for loop for everything
- Conditions must always result in true or false
Step 2: Slices and Maps
- Store lists of items in flexible slices that grow as your program needs more space.
Read more
Slices are flexible, growing lists that hold multiple items of the same type in order. Unlike rigid traditional arrays, slices can expand when you need more space.
Picture a shopping list written on a whiteboard where you can easily rub out items or add new ones to the bottom.
This matters because backend services frequently handle collections of records, like a list of active users or recent blog posts retrieved from a database.
- Slices are built on top of arrays
- Use the append function to add items
- Access items using zero-based index numbers
- Look up values quickly using key-value pairs just like a phone book.
Read more
Maps store data in key-value pairs, letting you look up information instantly using a unique label rather than searching through a numbered list.
Think of a phone contact list where you search for a friend by name to instantly find their phone number.
This matters because maps are ideal for fast data lookups, configurations, and caching information in backend web servers.
- Maps link unique keys to specific values
- Lookup is very fast regardless of size
- Use square brackets to access and set keys
- Use the range keyword to visit every item inside your slices and maps easily.
Read more
The range keyword is a handy tool designed to help you loop through slices and maps without messing about with manual index counters.
Imagine walking down a row of lockers and opening each one in turn to check its contents.
This matters because it cuts down on boilerplate code and makes your loops much safer and easier to read across all your projects.
- Works smoothly with both slices and maps
- Provides both the key and the value
- Use an underscore to ignore unused variables
Step 3: Structs and Interfaces
- Group related data fields together into custom structures that represent real-world things.
Read more
Structs allow you to bundle different variables together under one custom name to represent real-world objects in your code.
Think of a filled-out customer registration form containing their name, email address, and age all in one tidy bundle.
This matters because backend apps manage complex data structures, and structs let you model domain concepts cleanly.
- Defined using the type and struct keywords
- Fields can be of any data type
- Instantiated using field name colon syntax
- Attach functions directly to your custom structs to give them useful behaviors.
Read more
Methods are special functions attached directly to your custom structs, giving your data its own built-in behaviours.
Imagine a bank account struct that comes with its own deposit button attached directly to it.
This matters because methods keep your code organised, allowing data and the actions that modify it to live together in harmony.
- Defined with a receiver argument before the name
- Can access and modify struct fields
- Keeps related logic neatly encapsulated
- (optional)
- Define common behaviors so different types can be used interchangeably.
Read more
Interfaces define a set of method signatures without implementing them. Any struct that includes those methods automatically satisfies the interface.
Think of a remote control with standard buttons; any electronic device that has those buttons can be operated by it.
This matters because interfaces let you write flexible, decoupled code that is easy to extend and test.
- Interfaces specify required method lists
- Go implements interfaces implicitly automatically
- Promotes flexible and decoupled code design
Step 4: Errors and Testing
- Catch and check error values returned by functions instead of letting your program crash.
Read more
Go treats errors as ordinary values rather than throwing exceptions that crash your program. Functions return an error value alongside their normal result.
Think of a cash machine returning a polite receipt message saying cash is low instead of suddenly shutting down.
This matters because robust backend systems must handle unexpected issues, like lost database connections, gracefully without failing.
- Errors are returned as standard built-in values
- Always check if error is not nil
- Use errors dot New to create custom messages
- Use Go built-in testing tools to make sure your functions work exactly as expected.
Read more
Go has built-in testing tools that let you write automated checks to prove your code behaves correctly before you share it.
Think of a quality control checklist on a factory production line that tests every product before shipping.
This matters because tests save you hours of manual clicking and give you confidence when changing or updating your code.
- Test files must end with underscore test dot go
- Test functions start with Test followed by name
- Run tests using the go test command
- (optional)
- Organise your project code and download helpful third-party packages.
Read more
Modules help you organise your project files and manage helpful third-party packages created by other developers.
Think of a toolbox where you keep your own custom tools alongside specialised attachments bought from hardware shops.
This matters because real-world applications rely on external packages for tasks like logging and database connections.
- Initialise a module using go mod init
- Dependencies are tracked in go mod files
- Download packages automatically with go get
Step 5: Concurrency and Web
- Run multiple tasks at the exact same time using lightweight background threads.
Read more
Goroutines are ultra-lightweight threads managed by the Go runtime, allowing you to run multiple tasks at the exact same time.
Imagine a restaurant kitchen where multiple chefs prep different ingredients simultaneously rather than waiting for one to finish.
This matters because modern servers need to handle thousands of incoming web requests at once without slowing down.
- Spawn a goroutine using the go keyword
- Runs concurrently alongside other code
- Consumes very little memory overhead
- Send data safely back and forth between different running goroutines.
Read more
Channels are safe pipelines that let goroutines send data back and forth to each other without causing data corruption.
Think of a pneumatic tube system in a large office used to send documents securely between floors.
This matters because sharing data safely across concurrent threads is notoriously tricky in other languages, but Go makes it simple.
- Created using the make chan syntax
- Send and receive data using the arrow operator
- Blocks execution until both sides are ready
- Build a basic HTTP web server that responds to visitors on your local machine.
Read more
Go has a powerful standard library that lets you build a fully functioning HTTP web server without installing extra frameworks.
Think of setting up a shop counter where customers walk up, ask a question, and receive an instant reply.
This matters because building APIs and web servers is the primary job of backend developers using Go.
- Use net slash http package for server tools
- Register routes using http dot HandleFunc
- Start the server with http dot ListenAndServe