Skip to content
IT glossary
BackendUpdated December 3, 2026

Go

This programming language is used to build backend services and command-line tools. Go checks types before the program runs and makes it possible for one service to handle many tasks, such as incoming requests, concurrently.

Also known as: Golang

What Go is used for

Go is a compiled, statically typed programming language. You’ll also see it called Golang, especially in searches and job listings, but Go is the official name. It’s common in backend services, queue workers, networking tools, and infrastructure software. A backend team can build an HTTP API with the standard library, which includes packages for routing requests, encoding JSON, and writing tests.

What Go code looks like

Go groups source files into packages and tracks a module’s dependencies in go.mod. The compiler checks types even when they aren’t written out: in port := 8080, it infers int. Running go build on a main package produces an executable for the target operating system and architecture. You can run that executable without installing the Go toolchain on the target machine. A garbage collector reclaims memory the program can no longer reach.

Go uses structs and methods rather than classes and class inheritance. A type satisfies an interface by having the required methods; it doesn’t need to declare that it implements the interface. Functions typically return ordinary failures as error values, often alongside a result, so the caller can decide whether to handle the error or pass it up.

Example: returning JSON

package main

import (
    "encoding/json"
    "log"
    "net/http"
)

func main() {
    http.HandleFunc("/status", func(w http.ResponseWriter, r *http.Request) {
        w.Header().Set("Content-Type", "application/json")
        if err := json.NewEncoder(w).Encode(map[string]string{"status": "ok"}); err != nil {
            log.Printf("write status response: %v", err)
        }
    })
    log.Fatal(http.ListenAndServe(":8080", nil))
}

The handler sets the response header before writing the body, because the first write commits the headers. The server can run this handler concurrently for multiple requests. The map is created inside the handler, so requests don’t share it.

Concurrency: what Go does and what you still own

A go statement starts a goroutine, a task that the Go runtime schedules onto OS threads. Goroutines can overlap while waiting for I/O and can run in parallel when execution resources are available. Channels pass values between goroutines and can synchronize them; a mutex can protect shared mutable state. Neither approach automatically cleans up background work. For instance, if a request ends while a goroutine is trying to send a result nobody will read, that goroutine can remain blocked. Pass cancellation through a context.Context and make the goroutine check or wait for its cancellation signal.

What interviewers look for

Expect short code-reading questions about slices sharing a backing array, an interface holding a typed nil, or concurrent access to a map. In a concurrency exercise, explain where work starts, who receives the result, and what happens if the caller leaves early. That usually matters more than knowing the scheduler’s internal terminology.