ToolPopToolPop
Go · Lesson 1 of 22

Why Go, in one chapter

5 min readUpdated 25 Jun 2026

If you have spent two years writing Node.js backends and you keep hearing "we are rewriting it in Go", this lesson is for you. Go is the language behind most of the backend you actually use. Docker, Kubernetes, Cloudflare's edge, Grafana, CockroachDB, Razorpay's checkout, half of Swiggy's microservices. None of them are written in your favourite framework.

This lesson is short. We are going to talk about why Go won the cloud backend war, install nothing, and then read a five-line Go program that already shows you 80% of what makes Go feel different.

The Go pitch, in five bullets

  • One way to do things. No frameworks, no decorators, no DI containers. There is net/http and there is what you build on top of it.
  • Goroutines. A function call with go in front becomes a concurrent task. They cost ~2 KB each. You will launch thousands without thinking.
  • Static typing without ceremony. No Map<String, List<UserDTO>>. The compiler infers most of it. Errors are values, not exceptions.
  • One binary. go build gives you a single static executable. Drop it on a Linux box. No runtime, no package.json, no python venv.
  • Fast compile, fast run. Build times in seconds. Runtime within ~2x of Java. Way ahead of Python/Node for CPU-bound work.

Go is what you write when you stop being charmed by language features and start caring about the call from on-call at 3 AM.

Who actually uses Go (and why interviewers ask)

  • Backend platforms: Razorpay, PhonePe, Swiggy, Zomato, Flipkart all have Go services. Indian SaaS like Postman, FreshWorks, Zerodha.
  • Cloud-native: Kubernetes, Docker, Terraform, Prometheus, Vault, etcd, Caddy, NATS.
  • Databases: CockroachDB, InfluxDB, TiDB, Dgraph.
  • Edge / networking: Cloudflare workers tooling, Tailscale, V2Ray.

If you are interviewing for a senior backend role in India in 2026, the JD will ask for "Go OR Node OR Java". Knowing Go is a force multiplier because the pool of strong Go engineers is still smaller than the demand.

Your first Go program

go
package main
 
import "fmt"
 
func main() {
    fmt.Println("Hello from Go")
}

Five lines. Read them top to bottom.

  • package main: every Go file belongs to a package. main is special, it is the entry point for an executable.
  • import "fmt": the standard library's formatted I/O. No npm install.
  • func main(): the function that runs when the binary starts. Takes no arguments, returns nothing.
  • fmt.Println(...): print + newline. The capital P matters, we will see why in the next lesson.

That is a complete, compilable program. Save it as hello.go, run go run hello.go, and you are done. No package.json, no tsconfig, no Vite. Just one file and the compiler.

What is different from your other languages

  • No if (x != null). Zero values mean uninitialised variables have safe defaults (0, "", nil slices that you can still append to).
  • No try/catch. Errors come back as the second return value. You check them explicitly. Loud, but never silent.
  • No classes. Just struct types and functions that take them as receivers. Composition over inheritance.
  • No async/await. Just go func() { ... }() to launch a goroutine, and channels to talk between them.
  • No import * from .. Imports are explicit and grouped at the top.

Each of these will get its own lesson. We will build a small HTTP service by lesson 8.

What this track covers

Beginner path (8 lessons): language basics. Types, functions, slices, maps, structs, interfaces, errors, goroutines.

Senior path (12 lessons): the topics interviewers actually drill on. The memory model. context cancellation. The sync primitives. Channels deep. Generics. Performance. The "implement X" coding round.

If you read every lesson and do the assignments in the right panel, you will not need a separate interview-prep course. Promise.

The fastest way to learn Go is to write Go. The right panel of this lesson has a real Go program. Edit it, click Run, see what comes out. We will not learn the language by talking about it.

Onwards.

Chai0/2 done

Watching quietly. Tap me if you want a tip.

Go Playground

Go cannot run natively in a browser. Run copies your code and opens go.dev/play ; paste and click Run there.

Try this (0 of 2 done)

  1. 1

    Predict the output of the program in the editor.

    show answer
    package main
    
    import "fmt"
    
    func main() {
    	fmt.Println("Hello from Go")
    }
  2. 2

    Modify the program to print your name. Predict the output.

    hint

    Replace the string passed to fmt.Println.

    show answer
    package main
    
    import "fmt"
    
    func main() {
    	fmt.Println("Shailesh")
    }