Questions
Go questions
Choose a question page, learn the concept, then test your understanding with a quiz.
How to Iterate Over Map Keys in Go
Learn how to get and iterate over all keys in a Go map using range, with examples, common mistakes, and practical patterns.
How to Iterate Over a Range of Integers in Go
Learn how to loop over integer ranges in Go, why range does not work like Ruby, and practical patterns for counting with for loops.
How to Join a Slice of Strings into One String in Go
Learn how to join strings in Go using strings.Join, arrays vs slices, conversion syntax, examples, mistakes, and practical usage.
How to List a Directory in Go
Learn how to list files and folders in a single directory in Go using os.ReadDir, with examples, common mistakes, and practical patterns.
How to Measure Test Coverage in Go
Learn how to measure test coverage in Go using built-in tooling, read coverage reports, and improve unit test quality with practical examples.
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 Organize a Multi-File Go Project During Development
Learn how to structure Go packages, main programs, and tests during development, with practical examples for multi-file Go projects.
How to Pad Numbers With Leading Zeros in Python
Learn how to format numbers with leading zeros in Python using zfill, format, and f-strings for fixed-width output.
How to Parse RFC3339 / ISO 8601 Date-Time Strings in Go
Learn how to parse RFC3339 and ISO 8601 date-time strings in Go using time.Parse, layouts, and the built-in time.RFC3339 constants.
How to Pretty-Print JSON in Go
Learn how to pretty-print JSON in Go using json.MarshalIndent and json.Indent, with examples, mistakes, and practical usage.
How to Print Boolean Values in Go
Learn how to print boolean values in Go using fmt format specifiers, including %t, Println, and practical examples for beginners.
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 Print in Go Tests with the testing Package
Learn why output is hidden in Go tests and how to print debug information using fmt.Println, t.Log, and the -v flag.
How to Read Standard Input in Go
Learn how to read user input from the console in Go using bufio.Reader, fmt.Scanln, and common input-handling patterns.
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 Read an Entire File Into a String in Go
Learn how to read a whole file into a string in Go using standard library functions, with examples, pitfalls, and practical use cases.
How to Read an HTTP Response as a String in Go
Learn how to read an HTTP response body as a string in Go, convert []byte safely, and avoid common mistakes with net/http.
How to Read and Write Files in Go
Learn how to read from and write to files in Go with simple examples, file handles, byte slices, and common patterns for beginners.
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 Run All Go Tests in a Project with go test
Learn how to run all tests in a Go project using go test across the current directory and all subdirectories.