Skip to content

Go Programming

Master Go Programming with 50 free flashcards. Study using spaced repetition and focus mode for effective learning in Programming.

🎓 50 cards ⏱️ ~25 min Advanced
Study Full Deck →
Share: 𝕏 Twitter LinkedIn WhatsApp

🎯 What You'll Learn

Preview Questions

12 shown

What is Go (Golang)?

Show ▼

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.

How do you declare a variable in Go?

Show ▼

You can declare variables using:
var x int = 10
var y = "hello" (type inferred)
z := 42 (short declaration, only inside functions)

What is a goroutine?

Show ▼

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).

How do you create a channel in Go?

Show ▼

Use the make function:
ch := make(chan int) — unbuffered
ch := make(chan string, 5) — buffered with capacity 5
Channels are used to communicate between goroutines safely.

What is the difference between unbuffered and buffered channels?

Show ▼

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.

How do interfaces work in Go?

Show ▼

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.

How does error handling work in Go?

Show ▼

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 }

What is a package in Go?

Show ▼

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.

How do slices work in Go?

Show ▼

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.

How do you use maps in Go?

Show ▼

Maps are key-value collections:
m := make(map[string]int)
m["age"] = 30
val, ok := m["age"] — the comma ok idiom checks if a key exists. Maps are not safe for concurrent access without synchronization.

What is a struct in Go?

Show ▼

A struct is a composite type that groups fields:
type Person struct {
  Name string
  Age int
}

p := Person{Name: "Alice", Age: 30}

How do methods work in Go?

Show ▼

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.

🎓 Start studying Go Programming

🎮 Study Modes Available

🔄

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

Related Topics in Programming

📖 Learning Resources