CodeNebula
All paths

Go Fundamentals

Begin with Go's story, then master the core language — types, functions, structs, interfaces.

0 / 29 completed0%
1

Origins at Google (2007–2009)

Go was conceived in September 2007 by Robert Griesemer, Rob Pike, and Ken Thomps...

Go
2

Public Release — Go 1.0 (2012)

Go was open-sourced in November 2009. On March 28, 2012, Go 1.0 was released — t...

Go
3

Growth and Ecosystem (2012–2017)

Between Go 1.0 and Go 1.9, the language itself changed little (by design) but th...

Go
4

Go Modules — Dependency Management (Go 1.11, 2018)

Go's original dependency model relied on `GOPATH` — all Go code lived in one wor...

Go
5

Generics — Go 1.18 (2022)

Go 1.18, released March 2022, added generics (officially called "type parameters...

Go
6

Modern Go — 1.21 to 1.24 (2023–2025)

Go 1.21 (August 2023) added the first built-in functions for slices and maps as ...

Go
7

Why Go Succeeded

Go succeeded because it made opinionated choices that most languages avoid: one ...

Go
8

Variables and Type Inference

Go is statically typed but uses type inference to eliminate boilerplate. The `:=...

Go
9

Basic Types

Go has a small, fixed set of built-in types. Integer types are explicitly sized ...

Go
10

Functions

Functions are first-class values in Go. They can return multiple values — idioma...

Go
11

Control Flow

Go has `if`, `for`, and `switch` — no `while`, no `do-while`, no `until`. `for` ...

Go
12

Structs

Go uses structs for composite data types. There is no `class` keyword. Methods a...

Go
13

Interfaces

Interfaces in Go are satisfied implicitly — a type implements an interface simpl...

Go
14

Pointers

Go has pointers but no pointer arithmetic. A pointer holds the memory address of...

Go
15

Arrays and Slices

An array in Go has a fixed length that is part of its type: `[3]int` and `[4]int...

Go
16

Maps

A `map[K]V` is Go's built-in hash map. Keys must be `comparable` (no slices, map...

Go
17

Error Handling

Go uses explicit error return values instead of exceptions. The `error` interfac...

Go
18

Defer

`defer` schedules a function call to run when the surrounding function returns —...

Go
19

Closures

A closure is a function that captures variables from its enclosing scope by refe...

Go
20

Embedding

Go's alternative to inheritance is struct embedding. Embedding a type promotes i...

Go
21

Constants and iota

Constants are immutable values fixed at compile time, declared with `const`. The...

Go
22

Type Assertions

A type assertion extracts the concrete value stored inside an interface. `v, ok ...

Go
23

Type Switches

A type switch is a control structure that branches on the dynamic type of an int...

Go
24

Variadic Functions

A variadic function accepts a variable number of trailing arguments of the same ...

Go
25

Named Types and Type Definitions

`type Celsius float64` creates a new named type distinct from its underlying typ...

Go
26

init Functions

`init` is a special function that runs automatically before `main`, after all pa...

Go
27

The Blank Identifier

The blank identifier `_` is a write-only placeholder that discards a value. Go r...

Go
28

Panic and Recover

`panic` stops normal execution and begins unwinding the stack, running deferred ...

Go
29

Labels and goto

Go supports statement labels used with `break`, `continue`, and `goto`. A labele...

Go