Master Go Programming with 50 free flashcards. Study using spaced repetition and focus mode for effective learning in Programming.
Go is an open-source programming language developed at Google by Robert Griesemer, Rob Pike, and Ken Thompson. It is statically typed, compiled, and designed for simplicity, concurrency, and performance.
You can declare variables using:var x int = 10var y = "hello" (type inferred)z := 42 (short declaration, only inside functions)
A goroutine is a lightweight thread managed by the Go runtime. You start one with the go keyword:go myFunction()
Goroutines are multiplexed onto OS threads and are extremely cheap to create (only a few KB of stack).
Use the make function:ch := make(chan int) — unbufferedch := make(chan string, 5) — buffered with capacity 5
Channels are used to communicate between goroutines safely.
Unbuffered channels block the sender until the receiver is ready, and vice versa — they provide synchronization.
Buffered channels allow sending up to their capacity without blocking. The sender only blocks when the buffer is full.
Interfaces in Go are satisfied implicitly — a type implements an interface by implementing all its methods, with no explicit declaration needed:type Stringer interface { String() string }
Any type with a String() string method satisfies Stringer.
Go uses explicit error returns instead of exceptions:result, err := doSomething()if err != nil { log.Fatal(err) }
The error type is a built-in interface: type error interface { Error() string }
A package is Go's way of organizing code. Every Go file starts with package name. The main package with a func main() is the entry point. Exported identifiers start with an uppercase letter.
A slice is a dynamically-sized, flexible view into an array:s := []int{1, 2, 3}s = append(s, 4)
Slices have a length (len(s)) and capacity (cap(s)). They reference an underlying array.
Maps are key-value collections:m := make(map[string]int)m["age"] = 30val, ok := m["age"] — the comma ok idiom checks if a key exists. Maps are not safe for concurrent access without synchronization.
A struct is a composite type that groups fields:type Person struct {
Name string
Age int
}p := Person{Name: "Alice", Age: 30}
Methods are functions with a receiver argument:func (p Person) Greet() string {
return "Hi, " + p.Name
}
Use a pointer receiver (p *Person) to modify the struct or avoid copying.
Flashcards
Flip to reveal
Focus Mode
Spaced repetition
Multiple Choice
Test your knowledge
Type Answer
Active recall
Learn Mode
Multi-round mastery
Match Game
Memory challenge