Questions

Go questions

Choose a question page, learn the concept, then test your understanding with a quiz.

How to Convert a Unix Timestamp to time.Time in Go

Learn how to convert Unix timestamps to time.Time in Go using time.Unix, why time.Parse fails, and common mistakes to avoid.

gotimeunix-timestamp

How to Convert an int to a String in Go

Learn how to convert an int to a string in Go using strconv.Itoa and FormatInt, and why string(i) gives a character instead of digits.

gostringintegerconverters

How to Convert float64 to int in Go

Learn how to convert float64 to int in Go using type conversion, truncation rules, examples, mistakes, and practical use cases.

go

How to Declare a Constant Array or Slice in Go

Learn how to declare fixed data in Go, why const arrays are not allowed, and how to use arrays, slices, and variables correctly.

goarraysconstants

How to Delete a Key from a Map in Go

Learn how to remove entries from a Go map using delete(), with examples, common mistakes, and practical map usage patterns.

godictionary

How to Delete an Element from a Slice in Go

Learn how to delete an element from a slice in Go using append, slicing, and index checks with simple examples and common mistakes.

goslice

How to Disable or Bypass go test Caching in Go

Learn how go test caching works in Go and how to force tests to run again using practical commands and examples.

gotesting

How to Find the Type of an Object in Go

Learn how to inspect variable types in Go using reflect.TypeOf, %T, and type assertions with clear examples for beginners.

gogo-reflect

How to Format Time in Go Using yyyyMMddHHmmss

Learn how to format the current time in Go as yyyyMMddHHmmss using Go's reference time layout with clear examples and common mistakes.

gotimeformattimestamp

How to Format a String in Go Without Printing

Learn how to format and return strings in Go using fmt.Sprintf, with examples, comparisons, common mistakes, and a mini project.

gostringformattingstring-formatting

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.

gostringrandom

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.

godictionaryslice

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.

goslice

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.

goconfiguration-files

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.

gosslhttps

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.

gojson

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.

go

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.

go

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.

goarraysslice

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.

gogo-toolchain

Page 3 of 6 - 112 questions