Questions
Go questions
Choose a question page, learn the concept, then test your understanding with a quiz.
How to Generate a Random String of Fixed Length in Go
Learn how to generate fixed-length random letter strings in Go using simple, fast, and beginner-friendly techniques.
How to Handle Unused Variables and Imports in Go
Learn why Go reports unused variables and imports, how to fix them, and practical ways to work efficiently while developing Go code.
How to Multiply time.Duration by an Integer in Go
Learn why multiplying rand.Int31n() by time.Millisecond fails in Go and how to correctly work with time.Duration values.
How to Print Struct Variables in Go
Learn how to print struct fields in Go using fmt.Println, fmt.Printf, and formatting verbs with practical examples for beginners.
How to Read a File Line by Line in Go
Learn how to read a file line by line in Go using bufio.Scanner and readers, with examples, pitfalls, and practical patterns.
How to Remove Packages Installed with go get in Go
Learn how go get installs packages, where files go, and how to remove previously downloaded Go packages safely and cleanly.
How to Write Multiline Strings in Go
Learn how multiline strings work in Go using raw string literals and escaped strings, with examples, pitfalls, and practical use cases.
Idiomatic Enums in Go: Representing Fixed Values Like DNA Bases
Learn the idiomatic way to represent enums in Go using typed constants and iota, with examples for DNA bases like A, C, T, and G.
Optional Parameters in Go: How to Handle Missing Arguments
Learn how Go handles optional parameters, why function overloading is not supported, and common patterns to simulate optional arguments.
Struct Tags in Go: What They Are and How They’re Used
Learn what struct tags in Go are, how reflection reads them, and how packages like json, xml, db, and validation use them in real projects.
Understanding GOPATH and GOROOT in Go
Learn what GOPATH and GOROOT mean in Go, how they differ, and how to fix package not found errors during installation.
When Does init() Run in Go? Package Initialization Explained
Learn exactly when Go's init() runs, how package variables are initialized, and what happens before main() starts.
Page 2 of 2 - 32 questions