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 Get a Slice of Map Keys in Go
Learn how to collect map keys into a slice in Go, why iteration is required, and common patterns for sorting and using keys safely.
How to Get the Last Element of a Slice in Go
Learn the Go way to get the last element of a slice, handle empty slices safely, and avoid common indexing mistakes.
How to Handle Configuration in Go
Learn practical ways to handle configuration in Go using flags, environment variables, and config files with clear examples and patterns.
How to Handle HTTPS Requests with Invalid Certificates in Go
Learn how to make HTTPS requests in Go when a certificate is invalid, including custom trust, TLS config, and safe alternatives.
How to Handle JSON POST Requests in Go
Learn the correct way to read and decode JSON POST request bodies in Go using net/http and encoding/json.
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 Import Local Packages in Go
Learn how local package imports work in Go, why relative imports fail, and how to fix GOPATH and module-based imports correctly.
How to Initialize an Empty Slice in Go
Learn the correct way to initialize an empty slice in Go using make([]T, 0) or []T{}, with examples, differences, and best practices.
How to Install a Package with go get in Go
Learn how to use go get correctly in Go, including GitHub package paths, GOPATH basics, common mistakes, and practical examples.
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.