Skip to main content

Web for Gos

Web development in Go centres on the net/http package, which provides an HTTP server, handlers, routing and a client without external frameworks. Handlers read requests and write responses, and the database/sql package connects to databases through drivers, using prepared statements and connection pooling.

Stage: Standard Library · Part of the Go roadmap · Last reviewed 19 November 2026

What to learn in Web

Web interview questions

What is an http.Handler?

It is an interface with one method, ServeHTTP(ResponseWriter, *Request). Anything implementing it can serve requests, and http.HandlerFunc adapts ordinary functions. Middleware works by wrapping one handler in another.

Why set timeouts on an http.Server?

The default server has no timeouts, so slow or stalled clients can hold connections and goroutines indefinitely. Setting ReadHeaderTimeout, ReadTimeout, WriteTimeout and IdleTimeout protects resources and helps against slow-client attacks.

Where Web fits in the Go roadmap

Web belongs to the Standard Library stage (intermediate level), which takes about 20 hours. Batteries included.

Back to the full Go roadmap