# Go for Backend Services

> Learn Go's simple syntax, goroutines and standard library to build fast, easily deployed services. Free notes, key concepts, resources and a mini project.

Canonical: https://www.internhack.in/roadmaps/tracks/backend/go
Last updated: 2026-11-28

Learn Go's simple syntax, goroutines and standard library to build fast, easily deployed services.

Beginner · about 40 hours · difficulty 3/5

Learn first: [HTTP in Depth](https://www.internhack.in/roadmaps/tracks/backend/http-protocol)

**Go** was designed at Google for building networked services. It compiles to a single static binary, starts instantly, uses little memory and has concurrency built into the language. It is popular for infrastructure tools (Docker, Kubernetes and Terraform are written in Go) and high-throughput APIs.

### Why teams pick Go

- A small language you can learn in weeks, with one standard formatting style (`gofmt`).
- **Goroutines** (very cheap threads) and **channels** make concurrent code approachable.
- A strong standard library: `net/http` alone is production-capable, and recent versions support method and path patterns in the router.

### What to learn

- Types, structs, interfaces, slices, maps and explicit error handling (`if err != nil`).
- Modules (`go mod`), packages and project layout.
- `net/http`, `context` for cancellation and timeouts, `encoding/json`.
- Optional routers or frameworks such as **chi**, **Gin** or **Echo**, and database access with `database/sql`, **pgx** or **sqlc**.

### Pitfalls

- Leaking goroutines that wait forever on a channel. Always have a way to stop them, usually via `context`.
- Ignoring returned errors; the compiler will not force you to handle them well.

You are ready to move on when you can build a JSON API with `net/http`, graceful shutdown, request timeouts via `context` and a Postgres connection.

## Key concepts

- **Structs, interfaces and errors**
- **Goroutines and channels**
- **context package**
- **net/http standard library**
- **Go modules**
- **chi, Gin or Echo**
- **pgx and sqlc**

## Other options for this step

- [JavaScript on the Server with Node.js](https://www.internhack.in/roadmaps/tracks/backend/nodejs): Learn Node.js, its event loop, npm and a web framework like Express or Fastify to build HTTP APIs.
- [Python for Backend Development](https://www.internhack.in/roadmaps/tracks/backend/python): Use Python with Django, Flask or FastAPI to build readable, productive web services.
- [Java and the Spring Ecosystem](https://www.internhack.in/roadmaps/tracks/backend/java): Build enterprise-grade services with Java, Maven or Gradle and Spring Boot.
- [C# and ASP.NET Core](https://www.internhack.in/roadmaps/tracks/backend/csharp): Build cross-platform web APIs with C#, .NET and ASP.NET Core.
- [PHP and Laravel](https://www.internhack.in/roadmaps/tracks/backend/php): Use modern PHP with Laravel or Symfony, the stack behind a large share of the web.
- [Ruby on Rails](https://www.internhack.in/roadmaps/tracks/backend/ruby): Build products quickly with Ruby and Rails' convention-over-configuration approach.
- [Rust for High-Performance Backends](https://www.internhack.in/roadmaps/tracks/backend/rust): Use Rust with Axum or Actix for memory-safe, very fast services, accepting a steeper learning curve.

## Mini project

Build a URL shortener in Go using only the standard library router, with graceful shutdown on SIGTERM and per-request timeouts.

## Check yourself

How does the context package help you avoid wasted work when a client disconnects?

## Free resources

- [A Tour of Go](https://go.dev/tour/) (go.dev)
- [Go documentation](https://go.dev/doc/) (go.dev)
- [Go by Example](https://gobyexample.com/) (gobyexample.com)

Previous: [Python for Backend Development](https://www.internhack.in/roadmaps/tracks/backend/python) · Next: [Java and the Spring Ecosystem](https://www.internhack.in/roadmaps/tracks/backend/java)

## More in Pick One Server Language

- [JavaScript on the Server with Node.js](https://www.internhack.in/roadmaps/tracks/backend/nodejs)
- [Python for Backend Development](https://www.internhack.in/roadmaps/tracks/backend/python)
- [Go for Backend Services](https://www.internhack.in/roadmaps/tracks/backend/go)
- [Java and the Spring Ecosystem](https://www.internhack.in/roadmaps/tracks/backend/java)
- [C# and ASP.NET Core](https://www.internhack.in/roadmaps/tracks/backend/csharp)
- [PHP and Laravel](https://www.internhack.in/roadmaps/tracks/backend/php)
- [Ruby on Rails](https://www.internhack.in/roadmaps/tracks/backend/ruby)
- [Rust for High-Performance Backends](https://www.internhack.in/roadmaps/tracks/backend/rust)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Backend Developer Roadmap](https://www.internhack.in/roadmaps/tracks/backend)
