Intermediate–Advanced 15 terms

Go (Golang)

Essential Go concepts: goroutines, channels, interfaces, context, and idiomatic patterns.

  • goroutine /ɡəʊˈruːtiːn/

    Lightweight thread managed by the Go runtime; created with the go keyword. Far cheaper than OS threads, allowing millions to run concurrently.

    "We launched a goroutine for each incoming request handler — the Go runtime multiplexes thousands of goroutines onto a small pool of OS threads."
  • channel /ˈtʃænəl/

    Typed conduit for sending values between goroutines; enforces synchronisation so both sender and receiver are ready at the same time (unbuffered).

    "The worker goroutine sends results to a channel and the main goroutine ranges over it, collecting results safely without mutexes."
  • interface /ˈɪntəfeɪs/

    Set of method signatures; satisfied implicitly — a type implements an interface by having all the required methods, with no explicit implements keyword.

    "Our storage layer depends on a Repository interface, so tests can swap in an in-memory implementation without touching production code."
  • struct /strʌkt/

    Composite type grouping named fields; Go's primary data structure. Methods are attached to structs via receivers.

    "We defined a User struct with fields for ID, Email, and CreatedAt, then attached a Validate method to it."
  • defer /dɪˈfɜː/

    Statement that schedules a function call to run when the surrounding function returns; commonly used for cleanup like closing files or releasing locks.

    "We defer db.Close() immediately after opening the connection so cleanup always runs even if the function returns early on error."
  • panic /ˈpænɪk/

    Built-in that stops normal execution and begins stack unwinding; similar to throwing an exception. Should only be used for truly unrecoverable errors.

    "The server calls panic when it cannot bind to the configured port — there is no point continuing if the application cannot start."
  • recover /rɪˈkʌvər/

    Built-in used inside a deferred function to stop a panic and restore normal execution; returns the value passed to panic.

    "Our HTTP middleware uses recover in a deferred function to catch any downstream panic and return a 500 response instead of crashing the server."
  • context.Context /ˈkɒntekst ˈkɒntekst/

    Standard interface for carrying deadlines, cancellation signals, and request-scoped values across API boundaries and goroutines.

    "Every database call receives the request context so a client disconnect automatically cancels in-flight queries and frees database connections."
  • go modules /ɡəʊ ˈmɒdjuːlz/

    Go's dependency management system using go.mod and go.sum; replaced GOPATH. Pins exact dependency versions for reproducible builds.

    "We ran go mod tidy after adding a new import — it updated go.mod with the dependency and go.sum with the cryptographic hashes."
  • embedding /ɪmˈbedɪŋ/

    Composing structs by including a type without a field name; promotes the embedded type's methods to the outer struct.

    "Embedding sync.Mutex in our Cache struct promotes Lock and Unlock methods to the outer type so callers write cache.Lock() directly."
  • method receiver /ˈmeθəd rɪˈsiːvər/

    The type a method is attached to; defined as func (t Type) MethodName(). Pointer receivers (func (t *Type)) can modify the value.

    "We used a pointer receiver on the Increment method so it modifies the counter in-place rather than working on a copy."
  • goroutine leak /ɡəʊˈruːtiːn liːk/

    A goroutine that is never garbage-collected because it is blocked waiting on a channel that is never closed or a timer that never fires.

    "The profiler showed 50,000 goroutines accumulating — a goroutine leak caused by sending to a channel nobody was reading from."
  • WaitGroup /weɪt ɡruːp/

    sync.WaitGroup; used to wait for a collection of goroutines to finish before proceeding. Add before launching, Done when finished, Wait to block.

    "We called wg.Add(len(urls)) before launching the goroutines and wg.Wait() at the end to ensure all downloads completed before writing the report."
  • mutex /ˈmjuːteks/

    sync.Mutex; ensures only one goroutine accesses a critical section at a time; prevents data races on shared state.

    "We protected the in-memory cache map with a sync.RWMutex — multiple goroutines can read concurrently but writes get exclusive access."
  • go fmt /ɡəʊ fɔːmæt/

    Standard code formatting tool that enforces a single canonical style; Go community convention is to always format code with gofmt before committing.

    "Our CI pipeline runs go fmt ./... and fails if any file differs — there are no style debates in code review because gofmt is the authority."

Ready to practice?

Test your knowledge of these terms in the interactive exercise.

Start exercise →